IRONSOFTWAREHOME
Set Paper Margins
using IronPrint;

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

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

' Define custom margins (left, top, right, bottom) 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
Set Paper Margins

Set Paper Margins

The PaperMargins property accepts a Margins object whose four parameters represent the left, top, right, and bottom margins in millimeters. Adjusting these values controls how much blank space surrounds the printed content on each edge of the page.

Custom margins are useful when documents must comply with binding requirements, letterhead positioning, or corporate style guides. For example, increasing the left margin accommodates hole-punch binding, while tighter margins maximize the printable area for data-heavy reports. All values are passed to the print driver before rendering, so the output matches your specifications regardless of the printer's default margin settings.

Explore the Complete Paper Margins Guide for IronPrint

Ready to Get Started?

Nuget Downloads 46,090Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required