Xojo Conferences

DynaPDF Manual - Page 720

Previous Page 719   Index   Next Page 721

Function Reference
Page 720 of 770
The function adds preferred print settings to the PDF file. Viewer applications use the print settings
to initialize the print dialog. Print ranges, if set, consist of two numbers which define the start and
end page number that should be printed.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
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
// Start writing a page to file
#define ptPrintPage
// 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!

Previous topic: ZUGFeRD, ZUGFeRD 2.0, Factur-X, SetPrintSettings

Next topic: SetResolution, SetSaveNewImageFormat, SetSeparationInfo