• 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: Modify python script, or best way to extract PDF pages?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modify python script, or best way to extract PDF pages?


  • Subject: Re: Modify python script, or best way to extract PDF pages?
  • From: has <email@hidden>
  • Date: Fri, 20 Jan 2006 11:15:44 +0000

Richard Ronnback wrote:

>Nor have I been able to use
>Automator and it's module for extracting pages, as it produces really whacky
>file names and I need full control over the output file names.

The Automator action writes files to a temporary location. You should capture those paths and rename the files yourself when moving them to their final destination.


>I do however notice that Automator uses a python script to do it's job, so I
>guess it would be possible to modify it. The script is located in "Macintosh
>HD:System:Library:Automator:Extract Odd & Even
>Pages.action:Contents:Resources:extract.py"

You can invoke that script from the shell if you prefer. e.g.:

    python extract.py  --input='/Users/foo/TEST.pdf'  --output='/Users/foo/TEST 1.pdf'  --slice='[0]'

will output the first page of the pdf to file 'TEST 1.pdf'. It wouldn't be much effort to hack up a version that outputs the whole lot in a single operation if you needed it; let me know.

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

  • Follow-Ups:
    • Re: Modify python script, or best way to extract PDF pages?
      • From: Richard Rönnbäck <email@hidden>
    • Re: Modify python script, or best way to extract PDF pages?
      • From: John Cochrane <email@hidden>
  • Prev by Date: Re: Modify python script, or best way to extract PDF pages?
  • Next by Date: Re: Modify python script, or best way to extract PDF pages?
  • Previous by thread: Setting Print window's Distiller option without UI Scripting
  • Next by thread: Re: Modify python script, or best way to extract PDF pages?
  • Index(es):
    • Date
    • Thread