Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 569

Previous Page 568   Index   Next Page 570

Function Reference
Page 569 of 750
sprintf(path, "%s/annot_%2d.png", OutDir, i);
// We store the result as PNG image in this example
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 into the image buffer.
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 picture inside the image.
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.
 

Previous topic: How to create image files

Next topic: Minimal initialization