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?
count pages theFile
2. How do I deal with situations where pages in original_pdf are of
different sizes?