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

DynaPDF Manual - Page 585

Previous Page 584   Index   Next Page 586

Function Reference
Page 585 of 750
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
RenderPDFFile (Rendering Engine)
LBOOL pdfRenderPDFFile(
const PPDF* IPDF,
// PDF Instance pointer
const char* OutFile,
// File name or directory
UI32 Resolution,
// Resolution in DPI
TRasterFlags Flags,
// Optional flags
TPDFPixFormat PixFmt,
// Output pixel format
TCompressionFilter Filter, // Compression filter for TIFF output
TImageFormat Format)
// Output image format
The function renders all PDF pages which are currently in memory and stores the result in a
proprietary image format. The pages in memory could be imported from one or more external PDF
files, e.g. with ImportPDFFile(), created with DynaPDF functions, or a combination of both.
The parameter OutFile can be a path to an existing directory or the file name of the output image.
The latter type can be used with TIFF images because this format supports multi-page output. When
a file path is used with a single page image format only the first page will be rendered.
The function calls the Ansi function stat() to determine whether the path is a directory or a file name.
A path to a directory must not end with a slash or backslash because stat() cannot identify a
directory in this case.
The parameter Resolution defines the resolution in which the pages should be rendered. On a 32 bit
system it is possible to render PDF pages in RGB with up to around 1200 DPI, depending on the
page format and available memory. The resolution of gray images can be higher but the encoder
must be able to handle such large images. The PNG and bitmap encoders accept images in almost
arbitrary resolutions but all other encoders fail when the resolution is larger than about 2000 DPI.
Rendering PDF files in very high resolutions requires special techniques like banding to restrict the
memory usage. However, such a feature is not available yet.
The function calls the TInitProgressProc() callback function, if set, to initialize a progress bar. The
parameter ProgType is set to ptWritePage. The TProgressProc() callback function is executed before
a page is rendered. The function breaks processing if the return value of the progress callback
function is non-zero. See SetProgressProc() for further information.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: 1 Bit Rendering

Next topic: ReOpenImportFile