pdfSetMidPageChangeCbk
Set a callback function for page changes (in middle of window).
void pdfSetMidPageChangeCbk(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 user hits the Page Up or Page Down key
- the user clicks on a hyperlink to a different page (or different PDF file)
- any of the "goto" or "scroll" functions are called
data
: the value passed in thedata
argument topdfSetPageChangeCbk
page
: the new page number
pdfSetPageChangeCbk
for a callback
triggered when the page at the top of the window changes.
C:
void myPageChangeFunc(void *data, int pageNum) {
Context *myContext = (Context *)data;
/* ... do something with the new page number ... */
}
....
pdfSetMidPageChangeCbk(viewer, &myPageChangeFunc, &myContext);