pvginkel / PdfiumViewer

PDF viewer based on Google's PDFium.
Apache License 2.0
972 stars 418 forks source link

Pdf Coordinates #135

Closed merco closed 7 years ago

merco commented 7 years ago

Hello. I'm trying to change the standard viewer to display annotations and links. I've modified PdfRenderer.GetPageLinks to use iTextSharp to get data from PDF. The problem is that I have the Rect Coordinates relative to PDF Points.

How con I change (for example) PdfRenderer.OnSetCursor to get the right coordinates in PDF points? Something like is not working.

var size = TranslateSize(Document.PageSizes[page]); PdfPoint pp = this.PointToPdf(location); Point lc = new Point((int) pp.Location.X, (int) (size.Height - pp.Location.Y)); if (link.Bounds.Contains(lc ))