Re: Splitting PDFs into single pages
Re: Splitting PDFs into single pages
- Subject: Re: Splitting PDFs into single pages
- From: Tim Mansour <email@hidden>
- Date: Thu, 25 Jan 2007 12:07:31 +1100
On 17/01/2007, at 7:04 pm, Emmanuel wrote:
I'm creating a script to be attached to a watched folder that will
take a (press-ready) PDF and split it into separate pages. Is
Smile suitable for this?
Very suitable.
And is is possible to do without opening unnecessary graphic windows?
You have to open one graphic window only, and (once your script
final) you may make it invisible to speed up the script (you save
the time to draw the images.)
I notice that by using BeginPDF I don't have to open a graphic window
at all. I'm currently playing with something like this...
set original_pdf to (choose file of type "com.adobe.pdf" without
invisibles)
set r to GetMediaBox(original_pdf)
set page to 1
BeginPDF(r)
DrawPDF(original_pdf, {0, 0}, "", page)
set pdata to EndPDF()
set the_name to "page " & page & ".pdf"
tell application "Finder" to set the_file to (make new file at
desktop with properties {file type:fourzero, name:the_name}) as alias
write pdata to the_file
... and that seems to work. But I want this to be in a loop in order
to make one PDF per page, so that raises two questions:
1. How do I determine the number of pages in original_pdf?
2. How do I deal with situations where pages in original_pdf are of
different sizes?
--
Tim Mansour <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden