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
public Bitmap PageToBitmap(
	int pageNumber,
	Nullable<int> imageMaxWidth,
	Nullable<int> imageMaxHeight,
	int DPI = 72


Type: SystemInt32
The page number to be converted to an image.
Type: SystemNullableInt32
The target maximum width of the output images.
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