Skip to main content

dxPDFDocumentExportToImageEx(TdxPDFDocument,Integer,Double,TdxSmartImage,TcxRotationAngle,TdxTaskCancelCallback) Method

Saves the specified page of the loaded PDF document at a specific zoom factor value to a Smart Image container.

Declaration

function dxPDFDocumentExportToImageEx(ADocument: TdxPDFDocument; APageIndex: Integer; const AZoomFactor: Double; AImage: TdxSmartImage; ARotationAngle: TcxRotationAngle = ra0; ACancelCallback: TdxTaskCancelCallback = nil): Boolean;

Parameters

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

Returns

Type
Boolean

Remarks

Call this global function to export a single page of the document loaded into a PDF document container passed as the ADocument parameter at a zoom factor value passed as the AZoomFactor parameter. Note that this parameter accepts a zoom multiplier rather than percentage used by the PDF Viewer control’s OptionsZoom.ZoomFactor property.

The dxPDFDocumentExportToImageEx function returns True if the page whose index within the document is passed as the APageIndex parameter, is successfully saved to a valid AImage Smart Image container; otherwise, False. Additionally, you can use the optional ARotationAngle parameter to apply the required rotation angle to the source page.

With the optional ACancelCallback parameter, you can provide a reference (in Delphi) or pointer (C++Builder) to a custom callback function to interrupt the document page export process in response to certain events occurring in your application. If the callback function returns True, a dxPDFDocumentExportToImageEx function call has no effect. Refer to the TdxTaskCancelCallback type description for more information.

Note

The dxPDFDocumentExportToImageEx global function does not create a Smart Image container internally. You need to pass a valid instance of the TdxSmartImage class or its descendant as the function’s AImage parameter to successfully save a document page with the required settings as an image.

See Also