pdfSetGDIOverlayCbk

Set a function to be called at the end of each page.
void pdfSetGDIOverlayCbk(PDFHandle pdf, void (*cbk)(void *data, HDC dc, int pageNum, int pageWidth, int pageHeight, int hDPI, int vDPI), void *cbkData)
This function sets a callback function to be called at the end of each printed page. The callback can use standard Windows GDI calls to add arbitrary overlays to the printed output.

The callback will be called with the following arguments:

The GDI overlay callback is only called in GDI mode (i.e., for non-PostScript printers, or if pdfPrintForceGDI has been called).
C:
void overlayCallback(void *data, HDC dc, int pageNum, int pageWidth, int pageHeight, int hDPI, int vDPI) { /* draw overlay content using the HDC handle, dc */ ... } ... pdfSetGDIOverlayCbk(pdf, &overlayCallback, NULL);
pdfAddOverlayText