设置纸张方向
using IronPrint;

// Configure landscape orientation for wide documents
var settings = new PrintSettings
{
    PaperOrientation = PaperOrientation.Landscape
};

Printer.Print("spreadsheet.pdf", settings);
NuGet下载
PM > Install-Package IronPrint
设置纸张方向

设置纸张方向

使用PaperOrientation属性来控制文档是以纵向还是横向方向打印。 将其设置为PaperOrientation.Landscape旋转可打印区域,使较长边横向运行,非常适合宽表格、时间线和演示幻灯片。

方向调整在驱动程序层级进行,且在内容栅格化之前完成,因此整个页面布局会自动调整。 将此设置与PaperSize结合使用,以精确控制内容如何填充纸张,避免尴尬的裁切或过多的空白。

了解如何使用 IronPrint 设置纸张方向

准备开始了吗?

NuGet 下载量 52,427版本:2026.11刚刚发布