Re: Maybe OT: getting general information of a pdf file
Re: Maybe OT: getting general information of a pdf file
- Subject: Re: Maybe OT: getting general information of a pdf file
- From: has <email@hidden>
- Date: Wed, 12 Oct 2005 00:22:26 +0100
demski wrote:
>is there maybe anybody out there knowing of how to get the general information (esp. page size (maybe even the different 'boxes'), count of pages) out of a pdf-file without opening it with preview or even Acrobat?
Take it you mean you don't want to open 'em in a GUI app. Can't suggest any CLI tools offhand: 'apropos pdf' doesn't turn up anything interesting, and 'pdf' isn't exactly the most productive term to Google for. Maybe someone else knows of something along those lines. Otherwise it sounds like you want to use Core Services. Unless you like C programming, the easiest way to do that would be to write a Python script that uses Apple's Core Services-to-Python bridge:
<http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_python/chapter_17_section_1.html>
(You'll need some patience to make sense of /Developer/Examples/Quartz/Python/API-SUMMARY, unfortunately, as its format is rather primitive.)
You could then run that script from AS using 'do shell script', passing it a path to the PDF file in question and having it return an tab/return-delimited string containing all the extracted data in easy-to-digest form.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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