PdfDocumentPageToBitmap Method (Int32, NullableInt32, NullableInt32, Int32)

Renders a single page of the PDF to a System.Drawing.Bitmap object.

Please add an assembly reference to System.Drawing to use this "PDF To Image" method

Please Dispose() each Bitmap object after use.

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 2020.10.3
Syntax
public Bitmap PageToBitmap(
	int pageNumber,
	Nullable<int> imageMaxWidth,
	Nullable<int> imageMaxHeight,
	int DPI = 72
)

Parameters

pageNumber
Type: SystemInt32
The page number to be converted to an image.
imageMaxWidth
Type: SystemNullableInt32
The target maximum width of the output images.
imageMaxHeight
Type: SystemNullableInt32
The target maximum height of the output images.
DPI (Optional)
Type: SystemInt32
The desired resolution of the output Images.

Return Value

Type: Bitmap
A System.Drawing.Bitmap of the rendered PDF page.
See Also
Download DLL or Install with Nuget