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:

The print job can be aborted by calling 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);
pdfAbortPrint