DynaPDF Manual - Page 642

Previous Page 641   Index   Next Page 643

Function Reference
Page 642 of 839
pdfCreateImage(PDF, path, ifmPNG);
pdfRenderAnnotOrField( PDF,
annot.Handle,
annot.Type != atWidget,
bsUp,
&img.PageSpace, // RenderPage() calculated the matrix
rfDefault,
pxfRGBA,
cfFlate,
&out);
pdfCloseImage(PDF);
}
pdfEndPage(PDF);
pdfFreePDF(PDF); // Release the PDF in memory
}
Return values:
0 The annotation or field was successfully rendered.
1 The annotation is hidden. No image was returned. In order to render hidden
annotations remove first the hidden flag with SetAnnotFlags() or SetFieldFlags().
2 The annotation or field contains no appearance stream. No image was returned.
< 0 An error occurred. No image was returned.
RenderPage (Rendering Engine)
Syntax:
LBOOL pdfRenderPage(
const PPDF* IPDF,
// Instance pointer
IPGE* PagePtr,
// Page pointer
IRAS* RasPtr,
// Pointer of the rasterizer
struct TPDFRasterImage* Img) // See below
struct TPDFRasterImage
{
UI32
StructSize;
// Must be set to sizeof(TPDFRasterImage)
TRasterFlags
Flags;
// See below
TPDFPageScale
DefScale;
// Specifies how the page should be scaled.
LBOOL
InitWhite;
// If true, the image buffer is initialized to white before
// rendering. When a clipping rectangle is set, only the area
// inside the clipping rectangle is initialized to white.
struct TIntRect ClipRect;
// Optional clipping rectangle defined in device coordinates
// (Pixels), default 0,0,0,0 (no clipping)
struct TCTM
Matrix;
// Optional transformation matrix. Initialize the variable to
// the identity matrix (1,0,0,1,0,0) if you don't need it. The
// matrix can be used to move and scale the page.
struct TCTM
PageSpace;
// Out -> The matrix represents the mapping from page space to
// device space. This matrix is required when further objects
// should be drawn on the page, e.g. form fields or annotations
// if rendered separately.
LBOOL
DrawFrameRect;
// If true, the area outside the page's bounding box is filled
// with the frame color. InitWhite can still be used, with or
// without a clipping rectangle.
UI32
FrameColor;
// Must be defined in the color space of the pixel format but in
// the natural component order, e.g. RGB.
TOnUpdateWindow* OnUpdateWindow; // Optional, UpdateOnPathCount and UpdateOnImageCoverage define
// when the function should be called
 

Previous topic: How to create image files

Next topic: Minimal initialization