該Margins物件,其四個參數分別表示上、右、下和左邊的邊距(以毫米為單位)。 調整這些值可以控制頁面每邊的印刷內容周圍留白的大小。
自訂邊距在需要符合裝訂要求、信頭定位或公司風格指南的文件中非常有用。 例如,增加左邊距適合打孔裝訂,而緊密的邊距則能最大化資料密集報告的可列印區域。 所有值在呈現前都會傳遞給列印驅動程式,因此輸出將符合您的規格,不受列印機預設邊距設置的影響。
探索IronPrint的完整紙張邊距指南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)該Margins物件,其四個參數分別表示上、右、下和左邊的邊距(以毫米為單位)。 調整這些值可以控制頁面每邊的印刷內容周圍留白的大小。
自訂邊距在需要符合裝訂要求、信頭定位或公司風格指南的文件中非常有用。 例如,增加左邊距適合打孔裝訂,而緊密的邊距則能最大化資料密集報告的可列印區域。 所有值在呈現前都會傳遞給列印驅動程式,因此輸出將符合您的規格,不受列印機預設邊距設置的影響。
探索IronPrint的完整紙張邊距指南Nuget Downloads 46,090|版本:2026.9剛剛發布