IRONSOFTWAREHOME
設定紙張邊界
using IronPrint;

// Define custom margins (top, right, bottom, left) in millimeters
PrintSettings printSettings = new PrintSettings();
printSettings.PaperMargins = new Margins(20, 15, 20, 15);

Printer.Print("invoice.pdf", printSettings);
Imports IronPrint

' Define custom margins (top, right, bottom, left) in millimeters
Dim printSettings As New PrintSettings()
printSettings.PaperMargins = New Margins(20, 15, 20, 15)

Printer.Print("invoice.pdf", printSettings)
NuGet Download
PM > Install-Package IronPrint
設定紙張邊界

設定紙張邊界

Margins物件,其四個參數分別表示上、右、下和左邊的邊距(以毫米為單位)。 調整這些值可以控制頁面每邊的印刷內容周圍留白的大小。

自訂邊距在需要符合裝訂要求、信頭定位或公司風格指南的文件中非常有用。 例如,增加左邊距適合打孔裝訂,而緊密的邊距則能最大化資料密集報告的可列印區域。 所有值在呈現前都會傳遞給列印驅動程式,因此輸出將符合您的規格,不受列印機預設邊距設置的影響。

探索IronPrint的完整紙張邊距指南

準備好開始了嗎?

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天試用金鑰
無需信用卡或帳戶建立