pdfSetPrintStatusCbk
Set a function to be called periodically while printing.
void pdfSetPrintStatusCbk(PDFHandle pdf,
void (*cbk)(void *data, int nextPage, int firstPage, int lastPage),
void *cbkData)
This function sets a callback function to be called before each page
is spooled, and after the last page is spooled. It is typically used
to update a print status dialog or similar.
The callback will be called with the following arguments:
data
: thecbkData
value that was passed topdfSetPrintStatusCbk
nextPage
: the next page to be printedfirstPage
: the first page in the print joblastPage
: the last page in the print job
pdfAbortPrint
from the
print status callback.
C:
void printStatusCbk(void *data, int nextPage, int firstPage, int lastPage) {
if (nextPage <= lastPage) {
/* about to print [nextPage] of [firstPage]..[lastPage] */
} else {
/* all done printing */
}
if (/* the user pressed the cancel button */) {
pdfAbortPrint(pdf);
}
}
...
pdfSetPrintStatusCbk(pdf, &printStatusCbk, NULL);