Convert PDF coordinates to window coordinates.
convertPDFToWindowCoords2([in] int page, [in] double pdfX, [in] double pdfY, [out] int *winX, [out] 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).

Dim winX As Long, winY As Long Dim page As Long Dim pdfX As Double, pdfY As Double ... viewer.convertWindowToPDFCoords2 winX, winY, page, pdfX, pdfY ... viewer.convertPDFToWindowCoords2 page, pdfX, pdfY, winX, winY