设置纸张尺寸
using IronPrint;

// Set the paper size to A4
PrintSettings printSettings = new PrintSettings();
printSettings.PaperSize = PaperSize.A4;

Printer.Print("report.pdf", printSettings);
NuGet Download
PM > Install-Package IronPrint
设置纸张尺寸

设置纸张尺寸

PrintSettings类上,可以让您为打印作业指定精确的纸张尺寸。 在此示例中,尺寸设置为PaperSize.A4,这是国际标准(210×297毫米),广泛用于商务函件和正式文件中。

IronPrint 支持多种内置纸张尺寸——包括 Letter、Legal、A3 等——因此您可以根据每个纸盒中装载的纸张进行匹配,而无需依赖打印机驱动程序的默认设置。 选择正确的尺寸可避免文档尺寸与实际纸张不符时出现内容裁切、意外缩放及纸张浪费的情况。

查看《IronPrint 指南》中所有可用的纸张尺寸

准备开始了吗?

Nuget Downloads 49,171版本:2026.11刚刚发布