• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

identify coordinate of text in pdf; and edit pdf based on coordinates

Community Beginner ,
Jun 15, 2022 Jun 15, 2022

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.

TOPICS
Scan documents and OCR , Standards and accessibility

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 15, 2022 Jun 15, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2022 Jun 15, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2022 Jun 15, 2022

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

LATEST

Thank you all for your responses.

I would encourage you to take a look at this use case and propose a silution (if available).

https://community.adobe.com/t5/acrobat-discussions/add-comment-pop-up-annotation-to-highlighted-text...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines