Question: I want to store the location of all images in a PDF, and then use that to track when a user clicks on an image in Universal (XOD) WebViewer. However, I am having issues with translating between the two formats, and get the rectangle in the wrong location. Answer: The following shows what information you need to store, and how to translate a rectangle from PDF to XOD coordinates. PDFNet SDK side Start with the ElementReader sample code and class
PDF.Rect bbox = image_element.GetBBox();
x1 = bbox.x1;
y1 = bbox.y1;
x2 = bbox.x2;
y2 = bbox.y2;
element_page = page_num;
var p1 = doc.GetXODCoordinates(element_page, x1, y1);
var p2 = doc.GetXODCoordinates(element_page, x2, y2);
var rect = new Annotations.Rect(p1.x, p1.y, p2.x, p2.y);
rect.normalize(); // make sure x1/y1 is top left corner, and height/width is positive
new_annot.setRect(rect);