Class PdfPaperSizeConverter
Class for converting PDF paper sizes from the PdfPaperSize enum to millimeters.
Inheritance
Namespace: IronPdf.Rendering
Assembly: IronPdf.dll
Syntax
public static class PdfPaperSizeConverter : Object
Working with PDF rendering in IronPDF runs through PdfPaperSizeConverter. It represents class for converting PDF paper sizes from the PdfPaperSize enum to millimeters.
PdfPaperSizeConverter matters when an application needs to configure or invoke PDF rendering from C# code. The class encapsulates the related options and behavior in a single object that is set up once and reused across render or processing calls. Typical scenarios include batch generation pipelines, templated document workflows, and integration with existing C# document services.
To use PdfPaperSizeConverter, instantiate or obtain it from the relevant entry point in the IronPDF C# API. Key methods include ToMillimeters. Assign options or invoke methods on the instance to configure or perform the operation. The custom paper size covers typical usage in C# end to end.
using IronPdf;
// Obtain PdfPaperSizeConverter from the relevant entry point in the IronPDF API
void Configure(PdfPaperSizeConverter instance)
{
instance.ToMillimeters();
}For the broader workflow, see the IronPDF C# documentation for related how-to guides and examples. For broader context, the PDF rendering portion of the IronPDF C# API contains related types that work with PdfPaperSizeConverter directly. PdfPaperSizeConverter exposes additional members beyond those highlighted above; the reference tables on this page list the full set. In application code, treat PdfPaperSizeConverter as a configured object that is constructed once and reused across operations rather than instantiated per call. Configuration is generally idempotent: assigning the same property value twice has the same effect as assigning it once. For diagnostic purposes, inspect the relevant PdfPaperSizeConverter property after each operation to confirm the configured state. See the constructors, properties, and methods tables below for the complete API surface of PdfPaperSizeConverter. Application code typically obtains or instantiates a single PdfPaperSizeConverter and shares it across multiple IronPDF operations rather than recreating it per call.
Methods
ToMillimeters(PdfPaperSize)
Converts the given PdfPaperSize value to its equivalent size in millimeters.
Declaration
public static (Length, Length) ToMillimeters(this PdfPaperSize paperSize)
Parameters
| Type | Name | Description |
|---|---|---|
| PdfPaperSize | paperSize | The PdfPaperSize value to convert. |
Returns
| Type | Description |
|---|---|
| System.ValueTuple<Length, Length> | A tuple that contains the width and height in millimeters for the specified PdfPaperSize enum value. |