Re: Reading a pdf text file
Re: Reading a pdf text file
- Subject: Re: Reading a pdf text file
- From: Rob Stott <email@hidden>
- Date: Sun, 9 Jan 2005 19:29:44 +0000
On 7 Jan 2005, at 10:44 pm, Gil Dawson wrote:
I looked at Acropbat V7.0 for $300 on the Adobe website, which would be OK, but I didn't see any promises about it being scriptable nor its being able to do what I want. (What is an enterprise solution, anyway?)
Acrobat is scriptable via AppleScript but I usually have more success with JavaScript. I often find myself using an Applescript to 'do' a Javascript.
If you end up getting the full version of Acrobat then you could save the PDF as text and then read the text file. For example...
--save the pdf out as a text document
tell application "Acrobat 6.0 ME Professional"
tell document 1
--save the file out as a text file using JavaScript
do script "this.saveAs(\"/myDoc.txt\", \"com.adobe.acrobat.plain-text\");"
end tell
end tell
--read the text document
set theText to do shell script "cat myDoc.txt"
...which works for me. You might be able to save the file as text using AppleScript, but (confession time) I got confused by Acrobat's AppleScript dictionary and resorted to JavaScript.
Hope that's of some help,
Rob
---
Rob Stott – Development Team, Trident UK
Work: +44 (0) 1482 887212 • Mobile: +44 (0) 7881 811533 • Home: +44 (0) 1482 671129
My Schedule: http://ical.mac.com/robstott/Robs32Dev32Schedule
I Work For: http://www.apple.com/uk/creative/trident/
My Band: http://www.superscapemusic.co.uk
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden