Set a callback function for page changes (at top of window).
void pdfSetPageChangeCbk(PDFViewerHandle viewer, void (*cbk)(void *data, int pageNum), void *data)
This function sets a callback function which will be called whenever the viewer displays a new page.

This callback is useful, for example, to update a "current page number" display in your application.

The page change callback is called whenever the displayed page number changes. This can happen in several ways:

The callback receives two arguments: In continuous mode, this callback is triggered when the page displayed at the top of the window changes. See pdfSetMidPageChangeCbk for a callback triggered when the page in the middle of the window changes.
void myPageChangeFunc(void *data, int pageNum) { Context *myContext = (Context *)data; /* ... do something with the new page number ... */ } .... pdfSetPageChangeCbk(viewer, &myPageChangeFunc, &myContext);