Skip to main content

dxPDFDocumentExportToPNG(TdxPDFDocument,Integer,Double,TdxSmartImage,TcxRotationAngle) Method

Saves the loaded PDF document as a PNG image (or a set of PNG images).

Declaration

function dxPDFDocumentExportToPNG(ADocument: TdxPDFDocument; APageIndex: Integer; const AZoomFactor: Double; AImage: TdxSmartImage; ARotationAngle: TcxRotationAngle = ra0): Boolean;

Parameters

Name Type
ADocument TdxPDFDocument
APageIndex Integer
AZoomFactor Double
AImage TdxSmartImage
ARotationAngle TcxRotationAngle

Returns

Type
Boolean

Remarks

This global function returns True if a document passed as the ADocument parameter is successfully exported; otherwise, False. Use the AZoomFactor parameter to specify a zoom factor value that should be applied to the exported document. The optional ARotationAngle parameter allows you to apply the required rotation angle to all pages of the exported PDF document.

The first overloaded variant of the dxPDFDocumentExportToPNG function allows you to save a single PDF document page whose zero-based index is passed as the APageIndex property to a Smart Image container object (in the PNG format) passed as the AImage parameter. Then, you can use the container’s ImageDataFormat property to convert the obtained image to any other supported bitmap format if necessary.

The second overloaded variant allows you to export the entire loaded PDF document as a set of PNG files saved to a destination folder passed as the AFolder parameter. Resulting PNG file names are comprised of a name prefix passed as the AFilePrefix parameter and serial numbers corresponding to PDF document page indexes. Additionally, you can specify an optional custom handler as the AHandler parameter.

For detailed information (including code examples) on the dxPDFDocumentExportToPNG function, refer to the How to Export an Entire PDF Document to a Set of PNG Files and How to Save Specific PDF Document Pages as PNG Files topics.

Note

The first overloaded dxPDFDocumentExportToPNG function does not create a Smart Image container internally; you must pass a valid instance of the TdxSmartImage class or its descendant as the function’s AImage parameter to save a document page as a PNG image.

See Also