Convert PDF coordinates to window coordinates.
void pdfConvertPDFToWindowCoords2(PDFViewerHandle viewer, int page, double pdfX, double pdfY, int *winX, int *winY)
XpdfViewer functions deal with two different coordinate spaces. In the window coordinate space, (0,0) is the upper-left corner of the window, and the units are pixels. In the PDF coordinate space, the origin is determined by the PDF file (and may even change from page to page), and the units are points (1 point = 1/72 inch).

This function converts a point from PDF coordinates (page, pdfX, pdfY) to window coordinates (returned in *winX, *winY).

int page, winX, winY; double pdfX, pdfY; page = ...; pdfX = ...; pdfY = ...; pdfConvertPDFToWindowCoords2(page, pdfX, pdfY, &winX, &winY);