DynaPDF Manual - Page 628

Previous Page 627   Index   Next Page 629

Function Reference
Page 628 of 818
// no alpha channel.
rfCompositeWhite
= 0x00001000, // Composite the image with a white
// background after rendering. This
// flag is meaningful only for pixel
// formats with an alpha channel.
rfExclPageContent = 0x00002000, // If set, only annotations and form fields will be rendered
rfExclButtons
= 0x00004000, // Exclude push buttons
rfExclCheckBoxes
= 0x00008000, // Exclude check boxes
rfExclComboBoxes
= 0x00010000, // Exclude combo boxes
rfExclListBoxes
= 0x00020000, // Exclude list boxes
rfExclTextFields
= 0x00040000, // Exclude text fields
rfExclSigFields
= 0x00080000, // Exclude signature fields
// ---------------------------------
rfScaleToBBox
= 0x00100000, // Meaningful only, if rfClipToArtBox, rfClipToBleedBox, or
// rfClipToTrimBox is set. If set, the picture size is set to the
// size of the wished bounding box.
rfDisableAAClipping
= 0x00200000, // Disable Anti-Aliasing for clipping paths. This flag is
// the most important one since clipping paths cause often
// visible artefacts in PDF files with flattened
// transparency.
rfDisableAAText
= 0x00400000, // Disable Anti-Aliasing for text.
rfDisableAAVector
= 0x00800000, // Disable Anti-Aliasing for vector graphics.
// Fully disable Anti-Aliasing.
rfDisableAntiAliasing
= rfDisableAAClipping | rfDisableAAText | rfDisableAAVector,
rfDisableBiLinearFilter = 0x01000000, // Disable the BiLevel filter for images. Sometimes useful
// if sharp images are needed, e.g. for barcodes.
rfClipBoxMask
= rfClipToArtBox | rfClipToBleedBox | rfClipToTrimBox // Internal flags
rfRenderInvisibleText
= 0x02000000
// If set, treat text rendering mode Invisible as Normal.
}TRasterFlags;
typedef SI32 PDF_CALL TOnUpdateWindow(const void* Data, TIntRect Area);
The function renders a PDF page into an image buffer. This function was mainly designed to render
PDF pages in a viewer application but it can also be used for other purposes where fast rendering
into an image buffer is required. It is also possible to render pages into a device context, see
RenderPageEx() for further information.
Before rendering the first page the application should set the path from which external CMaps can
be loaded (see SetCMapDir()). Set the path with the flag lcmDelayed so that the files will only be
loaded if necessary.
It is also strongly recommended to initialize color management before rendering the first page (see
InitColorManagement()) and to set the screen resolution (see SetScreenRes()). The output intent (if
any) is loaded automatically before the page will be rendered if color management is enabled.
Minimal initialization
A few members of the the structure TPDFRasterImage must be correctly initialized, otherwise
nothing can be rendered:
TPDFRasterImage img;
memset(&img, 0, sizeof(img));
img.StructSize = sizeof(img);
img.Matrix.a
= 1.0; // Identity matrix
img.Matrix.d
= 1.0; // Identity matrix (1.0, 0.0, 0.0, 1.0, 0.0, 0.0)
The structure size is used to identify different versions of the structure. The a and d members of the
transformation matrix represent the scaling factors. If these factors are set to zero, then nothing can
be rendered! The matrix should be set to the identity matrix, unless DefScale is set to psFitZoom.
 

Previous topic: RenderPage (Rendering Engine)

Next topic: Basics, Pixel Formats


Start Chat