Copy link to clipboard
Copied
Hi,
I need to make some changes at some specific locations in a pdf.
Can I extract the coordinate of concerned text or highlighted text of the pdf, and then perform some action on it (like adding comment, url, etc.) based on the coordinates?
Can somebody show an example script for that?
Thank you.
Copy link to clipboard
Copied
Hi Dave
Hope you are doing well and sorry for the trouble.
The option to pick text from PDF based on coordinates and to edit the text with these coordinates is not yet available. You may share your feedback with the engineering team using the link https://www.adobe.com/products/wishform.html
Regards
Amal
Copy link to clipboard
Copied
Actually, it might be possible using JavaScript - you can read the text on a page as a succession of words and quadrilaterals. Then you could add certain kinds of annotaton based on the coordinates. This is not extraction to a file.
Copy link to clipboard
Copied
As mentioned, this is possible with a script, but it's quite a complex task.
The coordinates of words can be accessed using the getPageNthWordQuads method and those of annotations using their quads property. You would then have to convert them into a rect-type array in order to use them to add things like links or form fields (or some types of comments; others use quads).
Copy link to clipboard
Copied
Thank you all for your responses.
I would encourage you to take a look at this use case and propose a silution (if available).