如何在 PDF 中使用 C# 配置打印设置 | IronPrint

How to Configure Print Settings

This article was translated from English: Does it need improvement?
Translated
View the article in English

打印设置是指规定文档或内容打印方式的配置或参数集。 这些设置包括纸张大小、方向(如纵向或横向)、打印分辨率(点/英寸 - DPI)、份数、打印机选择、页边距以及灰度打印等选项。 用户可以自定义这些设置,以实现特定的打印偏好和要求。

as-heading:2(快速入门:使用 IronPrint 设置进行配置和打印)</em

创建一个 PrintSettings 对象,设置纸张大小、方向、DPI、副本和灰度等几个属性,即可轻松上手。 然后调用 Printer.Print(...) 立即应用这些设置,无需复杂的设置。

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronPrint with NuGet Package Manager

    PM > Install-Package IronPrint

  2. Copy and run this code snippet.

    IronPrint.Printer.Print("document.pdf", new IronPrint.PrintSettings { PaperSize = IronPrint.PaperSize.A4, PaperOrientation = IronPrint.PaperOrientation.Landscape, Dpi = 300, NumberOfCopies = 2, Grayscale = true });
  3. Deploy to test on your live environment

    Start using IronPrint in your project today with a free trial
    arrow pointer