Custom PDF Size
One important aspect to note when creating your PDF documents in IronPDF is to make sure it can be viewed or printed well. This means you would have 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 you want 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.SetCustomPaperSizeinMilimeters
You can also use Renderer.RenderingOptions.PaperSize
, which is our custom preset paper size now accurate to 1 micron.