Set Custom Margins

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

This example shows how to set custom margins on your PDF document using IronPDF, a versatile tool for generating and editing PDFs in .NET applications. For more information about IronPDF and its capabilities, visit the IronPDF official website.

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.