• 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: Applescript to burst multi-page PDFs into a series of single pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript to burst multi-page PDFs into a series of single pages


  • Subject: Re: Applescript to burst multi-page PDFs into a series of single pages
  • From: peter boardman <email@hidden>
  • Date: Fri, 31 Jan 2003 10:23:13 +0000

Steve Hussey (email@hidden) said on 30/1/03,
14:40:
>I have a number of PDFs which have multiple pages (many
>thousands). I want to be able to write a script that
>will split each PDF into 1000s of individual PDF files,
>where each PDF file is one unique page of the original,
>in the order that they were in the original file.
>
>If the original document was named 'FooBar.PDF' each
>PDF would be named FooBar0001.PDF, FooBar00002.PDF etc.
>
>Acrobat has an Extract Page command but this does not
>appear in its AppleScript Dictionary. Any suggestions?

One solution is to use the other page moving commands. For example:

--
set sourcefile to choose file -- source file

tell application "Acrobat 4.0"
-- open source document
open (sourcefile as alias)
set sourcedoc to document 1 -- ????

-- set up a temporary document
set tempdoc to make document

-- get the current length of the source file
set pagecount to count PDPage of sourcedoc

-- go through source doc and copy each page to temp
repeat with i from 1 to pagecount
set active doc to sourcedoc
replace pages tempdoc over 1 from sourcedoc starting with i number of pages 1 without merge notes
set t to "" & (path to desktop) & "test" & i & ".pdf"
save tempdoc to file t
end repeat
end tell
--

However, you should note that:

1: I hate scripting Acrobat - I don't understand the document addressing techniques.
2: This is an old script that ran with Acrobat Exchange 2.1 last century - I haven't upgraded to Acrobat 5.
3: This script is not reliable - it fails in a different way every other time. One problem can be avoided if you quit
Acrobat before you run the script.
4: Doesn't this screw up all bookmarks?

But the idea of copying to a temporary document might help.

Cheers

Pete
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Applescript to burst multi-page PDFs into a series of single pages (From: Steve Hussey <email@hidden>)

  • Prev by Date: Re: Applescript to burst multi-page PDFs into a series of single pages
  • Next by Date: Re: Very strange dates - BUG
  • Previous by thread: Re: Applescript to burst multi-page PDFs into a series of single pages
  • Next by thread: Re: Applescript to burst multi-page PDFs into a series of single pages
  • Index(es):
    • Date
    • Thread