PDFium Delphi Component Docs

ChooseRenderFlags method

Component: TPdf  ·  Unit: PDFium
Chooses native render flags from the final scale and the destination size

Syntax

function ChooseRenderFlags(Scale: Double; DestWidth, DestHeight: Integer): Integer;

ScaleDouble. Final scale factor of the render, where values below 1.0 mean the page is being reduced
DestWidth, DestHeightInteger. Size of the destination bitmap in pixels
ResultInteger. Bitwise combination of FPDF_RENDER_* flags, or 0 when the defaults are appropriate

Description

Two situations call for non-default flags, and both depend on numbers a caller only knows at render time. Below a scale of 0.5, FPDF_RENDER_FORCEHALFTONE gives better image quality than the default interpolation, because source pixels far outnumber destination pixels. Above roughly four megapixels of destination bitmap, FPDF_RENDER_LIMITEDIMAGECACHE keeps a page full of large images from exhausting memory

The result is meant to be combined with whatever the application already sets, so a zoom-out view and a poster-sized export each get the flags that fit without hard-coding one flag set for every zoom level

Flags are returned as an integer for the native render entry points; the higher-level RenderPage overloads take a TRenderOptions set instead

See Also

RenderPage, PageComplexity, RenderPageBanded, RenderTile