Xojo Conferences
XDCMay2019MiamiUSA
MBSOct2019CologneDE

DynaPDF Manual - Page 716

Previous Page 715   Index   Next Page 717

Function Reference
Page 716 of 766
SetProgressProc
Syntax:
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
#define ptPrintPage
2
// Start printing a PDF file
#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 when importing a PDF file with ImportPDFFile(), when
printing a PDF file with PrintPDFFile(), and when closing the current PDF file.
The parameter Data is a user defined pointer which is passed unchanged to the callback functions.
The parameter InitProgress defines the 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 a page or writing 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.
The callback functions use the calling convention standard call on Windows. It is required to use the
correct calling convention; a wrong calling convention causes an access violation!
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.
Return values (SetProgressProc()):
 

Previous topic: SetPrintSettings

Next topic: SetSeparationInfo