Set Custom Margins

IronPDF allows you to edit margins to any value using RenderingOptions. HTML to PDF output options for ChromePdfRendererspecifies options such as paper size, DPI, headers and footers, and other Chromium-specific browser setup options. We can also set custom margins with the feature.

This example shows how to set custom margins on your PDF document using IronPDF.

The margins can be measured and set in millimeters or inches. For example, the bottom PDF paper margin is in millimeters and can be set to zero to create a document for borderless and commercial printing applications.

However, the default value is 25. For the desired effect, you can customize the top, bottom, left, and right borders individually.