IRONSOFTWAREHOME
打印设置
using IronPrint;

// Configure print setting
PrintSettings printSettings = new PrintSettings();
printSettings.Dpi = 150;
printSettings.NumberOfCopies = 2;
printSettings.PaperOrientation = PaperOrientation.Portrait;

// Print the document
Printer.Print("newDoc.pdf", printSettings);
Imports IronPrint

' Configure print setting
Dim printSettings As New PrintSettings()
printSettings.Dpi = 150
printSettings.NumberOfCopies = 2
printSettings.PaperOrientation = PaperOrientation.Portrait

' Print the document
Printer.Print("newDoc.pdf", printSettings)
NuGet Download
PM > Install-Package IronPrint
打印设置

打印设置

实例化PrintSettings类并根据您的要求进行配置。 最后,将**PrintSettings**对象传递给其中一个打印方法。 请查看以下所有可用的打印设置:

  • IronPrint.PrintSettings类的新实例,具有默认值。
  • paperSize
  • Landscape)。
  • printResolution
    • 备注:用于打印的实际Dpi可能会受到打印机能力的限制。
  • numberOfCopies。 -备注:在某些平台上,可能存在一些限制,导致无法准确复制多个副本。 在这种情况下,IronPrint.PrintSettings.NumberOfCopies的指定值可能会被忽略,导致仅打印一份。
  • printerName
    • 备注:如果您在PrintDialog中选择打印机,这个设置将被忽略。 要获得可用的打印机名称,可以使用IronPrint.Printer.GetPrinterNamesAsync获取打印机名称列表。
  • paperMargins以用于以毫米为单位进行打印。
  • grayscale进行打印。
  • Flatten PDF,这对于显示表单字段值和图像非常有用。
    • 注意:默认值为false,表明PDF将在打印之前被平整化。
  • Tray。 这样,用户可以指定要从哪个纸盒向打印机送纸。
    • 备注:如果您在tray,这项设置将被忽略。 要获得可用的IronPrint.Printer.GetPrinterTraysAsync(System.String)。 默认值为null,表示使用打印机提供的默认纸盘。 此纸盘选择属性仅在Windows中可用。
使用 IronPrint 探索详细的打印设置指南
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 46,090版本:2026.9刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
预约您的免费现场演示
Booking Badge

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥
无需信用卡或创建账户