pdfGetWindowPageRange

Get the range of pages intersected by a window coordinate rectangle.
void pdfGetWindowPageRange(PDFViewerHandle viewer, int left, int top, int right, int bottom, int *firstPage, int *lastPage)
This function takes a rectangle, in window coordinates, and returns the first and last page numbers that are inside that rectangle.

This can be useful, for example, in pdfSetRedrawCbk handlers, to figure out which pages need to be redrawn.

C:
void redrawCbk(void *data, HDC dc, int left, int top, int right, int bottom) { int firstPage, lastPage; pdfGetWindowPageRange(viewer, left, top, right, bottom, &firstPage, &lastPage); /* update firstPage .. lastPage */ } ... pdfSetRedrawCbk(viewer, &redrawCbk, NULL);
pdfSetRedrawCbk