Hello,
I am developing for Universal App with latest PDFNet SDK
I use PDFDraw to export thumbnail of PDF, and display them on screen.
The question is, on the real PDF, there will be annot (link, phone number, email address). How can I translate my touch point on the image to execute the appropriate annot? (I wrap the Image inside a grid)
I am able to get the coordinate of touch point, and it absolutely different from the coordinate of annot.
Thanks
`
doc.GetPage(1).GetAnnot(0);
`
The annotation’s coordinates are in PDF coordinates, like the crop box of the page. So you can figure out the location of the annot within the page based on those coordinates.
For example, in the following diagram:
±------------------------------------------+ <---- <x2, y2>
PDF Page |
±------+ <— <xb, yb> |
PDF | |
Annot | |
<xa, ya> —> ±------+ |
<x1, y1> ----> ±------------------------------------------+
the crop box’s coordinates in PDF coordinate space are from <x1,y1> to <x2,y2>, and the annotation’s coordinates are from <xa,ya> to <xb,yb>.
From that, you should be able to find the annotation’s location within the thumbnail.