如何在 C# 中配置 PDF 打印設置 | 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