Custom PDF Size
One important aspect to note when creating your PDF documents in IronPDF is to ensure they can be viewed or printed well. This means you need to define the target virtual paper size of the PDF and its related real-world paper size.
In this example, we show you how to add custom paper sizes to your PDF projects.
IronPDF supports close to 50 preset paper sizes and unlimited custom paper sizes that should fit every scenario or situation where you'd like your PDF to fit. You can render PDFs in different paper sizes measured in inches or millimeters.
The enum PdfPaperSize
class defines the target virtual paper size of the PDF and its related real-world paper size.
You can use the following methods to create PDFs of custom size in inches or millimeters:
Renderer.RenderingOptions.SetCustomPaperSizeInInches
Renderer.RenderingOptions.SetCustomPaperSizeInMillimeters
You can also use Renderer.RenderingOptions.PaperSize
, which is our custom preset paper size, now accurate to 1 micron.
For more detailed information on how to utilize IronPDF's custom paper size functionality and other advanced features, visit the IronPDF Documentation.
Discover how to create PDFs with custom dimensions using IronPDF - Learn More!