Skip to main content
idjev
Known Participant
January 25, 2024
Question

Export characters from a specific field

  • January 25, 2024
  • 2 replies
  • 1054 views

How can I export the characters (10-12 characters) within a certain area of a PDF document (A4) to txt?

 

Does anyone have any ideas or guidance on this matter?  Thank you.

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
January 25, 2024

A script can be used to identify text in a specific part of a page, but it's not a trivial task.
You would need to iterate over the entire page's contents, checking the quads array for each word, which defines its location(s) on the page, and compare it to a known rectangle that represents the area you're looking for.

Nesa Nurani
Community Expert
Community Expert
January 25, 2024

Is this a form field or a plain text?

Where exactly do you want to export it?

idjev
idjevAuthor
Known Participant
January 25, 2024

Pdf file as shown in attachment,

I want to transfer the marked part to a .txt file

Thom Parker
Community Expert
Community Expert
January 25, 2024

The text in that image looks very much like a form field. Is it a form field?  Or is it text that is part of the page content. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often