[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

How to detect text in a pdf?

(Follow-on to http://www.experts-exchange.com/Web/Graphics/Adobe_Acrobat/Q_21415298.html)

Hello fellow experts

I have an Access report that prints out pdf's.   In one section, there is a 'table-like' listing of a column header, with anywhere from one to ten rows.  I'd like to be able to detect the final row in this section, and then create form fields immediately below that.

Is this possible?

TIA
-Jim
0
Jim Horn
Asked:
Jim Horn
  • 2
1 Solution
 
Karl Heinz KremerCommented:
Is there anything below the last row? If not, you can use the "wordfinder" to enumerate all "words" in your document, while keeping track of the box around the "word" (in your case, we are probably not talking real words, but numerical data). Once you are done with the whole page, you can then take the lowest box coordinates, and place your fields just below that. Look into the JavaScript reference for teh methods doc.getPageNthWord, doc.GetPageNthWordQuads and doc.getPageNumWords.

You would first get the number of words on the page, and then in a loop get the "Quads", which are the coordinates that define the bounding box around the word. And as usual, you can access these methods via the JSObject from your VBA program.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Okay.  I'll give this a shot...
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
I'm going to pass on this solution, as my needs would be for this report, as one page, repeated many times throughout the .pdf.  Thanks for explaining this for me though.

-Jim
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now