DynaPDF Manual - Page 766

Previous Page 765   Index   Next Page 767

Function Reference
Page 766 of 818
LBOOL pdfSetProgressProc(
const PPDF* IPDF,
// Instance pointer
const void* Data,
// User defined pointer
const void* InitProgress, // Initialization callback function
const void* Progress)
// Progress callback function
typedef SI32 TProgType;
#define ptImportPage
0 // Start page import
#define ptWritePage
1 // Start writing a page to file or buffer
#define ptPrintPage
2 // Start printing the PDF file
#define ptConvertPage 3 // Start converting the PDF file (Optimize(), CheckConformance())
#define PDF_CALL __stdcall
// Windows only, otherwise empty
typedef void PDF_CALL TInitProgressProc(
const void* Data,
// User defined pointer
TProgType ProgType,
// Current process, see above
SI32 MaxCount);
// The number of callback function calls
typedef SI32 PDF_CALL TProgressProc(
const void* Data,
// User defined pointer
SI32 ActivePage);
// Current page number
The function sets two callback functions which can be used to control a progress bar. This function is
absent in the Visual Basic interface because this interface uses events instead of callback functions.
The progress callback functions are called by these functions:
CloseFile(), CloseFileEx(), and so on
The parameter Data is a user defined pointer that is passed unchanged to the callback functions.
The parameter InitProgress defines a callback function that is called before the progress callback
function is called the first time. The parameters of this callback function can be used to initialize a
progress bar. The parameter ProgType of the initialization callback function defines the current
process; this can be either importing, writing, or converting a page.
Other operations do not call the progress callback functions because most operations are too fast as
if they could be used to display the current progress.
The parameter MaxCount defines how often the progress callback function will be called. To disable
the progress callback functions set the parameters InitProgress and Progress to NULL.
Return values of the progress callback function:
The return value of the progress callback function must be 0, any other return value breaks
processing. All functions, except ImportPDFFile(), release the PDF file in memory if a non-zero
value will be returned.

Previous topic: SetPrintSettings

Next topic: SetResolution, SetSaveNewImageFormat, SetScreenRes (Rendering Engine)

Start Chat