These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Extract text from particular location

msstrend
Registered: Mar 15 2007
Posts: 53

Hi,

I want to extract text in all page from particular location say from X: 100 to X:200 and Y: 100 to Y:200

Can you please give me a script to do that?

Regards
Saravanakumar

My Product Information:
Acrobat Pro 7.0.9, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is not a simple operation. To write this code you'll need a good knowledge of PDF page geometry. Here are two articles that discuss this:

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/page_bounds/

http://www.acrobatusers.com/tutorials/2007/10/auto_placement_annotations/

To find words on a page and thier coordinates use the "doc.getPageNthWord()" and "doc.getPageNthWordQuad()" functions. You'll find and example in the Acrobat JavaScript Reference.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

clien
Registered: Nov 14 2008
Posts: 5
I like to extract text from a searchable pdf and I know the coordinates of texts. Is there any way to extract the text from the searchable pdf?

Thanks,
clien
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why Yes, there is. But I have the same advice as in the previous post. The functions needed for extracting the text are "doc.getPageNthWord()" and "doc.getPageNthWordQuad()". And take a look at the articles mentioned above.

One of the most important parts of identifying a specific location on the document is correct handling of the coordinates. Hence the importance of the article on Page Boundaries.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script