I am evaluating Aspose.PDF with the goal of being able to draw a box around phrases determined by the application. My strategy is to render the pdf as an image, then capture the position information of the text and use positioning to draw the box in HTML/CSS.
I prototyped the system with Aspose.PDF, capturing the positions of all text in the pdf with
SaveFormat.MobiXML. I captured an image of the first page of the document with
pngDevice.process(doc.getPages().get_Item(1). When I use the top, right, width and height provided by the xml to draw a box over the png, it’s shifted a bit left and a bit down. It really not enclosing the text accurately enough to display to a user. Is MobiXML the right approach for this application, or am I doing something wrong?
I’ve attached an image to this message that illustrates the problem.
Thanks very much – Bill
Screen Shot 2018-03-29 at 10.28.57 AM.png (585.7 KB)