• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Splitting PDFs into single pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Splitting PDFs into single pages


  • Subject: Re: Splitting PDFs into single pages
  • From: Emmanuel <email@hidden>
  • Date: Thu, 25 Jan 2007 02:25:13 +0100

At 12:07 PM +1100 1/25/07, Tim Mansour wrote:
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?

pdf boxes theFile page iPage

(all is in Smile's dictionary)

Emmanuel
_______________________________________________
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
  • Follow-Ups:
    • Re: Splitting PDFs into single pages
      • From: Bruce Robertson <email@hidden>
References: 
 >Splitting PDFs into single pages (From: Tim Mansour <email@hidden>)
 >Re: Splitting PDFs into single pages (From: Emmanuel <email@hidden>)
 >Re: Splitting PDFs into single pages (From: Tim Mansour <email@hidden>)

  • Prev by Date: Re: Splitting PDFs into single pages
  • Next by Date: Re: Splitting PDFs into single pages
  • Previous by thread: Re: Splitting PDFs into single pages
  • Next by thread: Re: Splitting PDFs into single pages
  • Index(es):
    • Date
    • Thread