Link to home
Start Free TrialLog in
Avatar of Zack
ZackFlag for Canada

asked on

extracting pdf info

Hi all,

I'm working with a non profit and need your help....i have to extract one piece of printed text from a pdf file on each page and save that page to a file name based on the extracted data.

Can anyone give me a starting point?

Thanks!
Zack
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Can  you please provide a little bit more information about what you need to do.
Avatar of Zack

ASKER

Sure!  There is basically about 100 pages.  In the upper right hand corner of each pdf there is a city name.  I need to take each page, extract that city name and take that individual page save it to a new file with that city name as the file.

Thanks
This problem does not have a straight forward solution... You need to find out - based on context - what the city name is. PDF does not have a good way to identify objects on a page, so you need to get all the text from the page, and then compare the position of the text to where you would expect the city name to be.

What tools do you want to use?

Do you have any experience with JavaScript? Acrobat allows you to write a JavaScript program that can extract all the text on a page, and it will present that text word by word with location information. Take a look at the Doc level functions getPageNumWords, getPageNthWord and getPageNthWordQuads. You then have to compare the words and locations you find to the area that you are interested in, and once you've identified the city (e.g. based on words that are around the city name), you need to save the page. JS also provides functions to do that.
Avatar of Zack

ASKER

I have a little experience with javascript.  I know PHP and perl.  Ok will look at those functions.
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zack

ASKER

ok appreciate it!  will check into it thanks