• 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 12:44:13 +0000

John Cochrane  wrote:

>Is there any python way for joining pages and discovering the number of pages as well?

OS X has provided a Python wrapper around most of the CoreGraphics API since Panther. You'll have to learn CoreGraphics (and Python) in order to use it, of course. There's some examples and crude API docs at:

/Developer/Examples/Quartz/Python

I think the cover.py example is close to what you want for joining pages. Example of counting pages:

#!/usr/bin/env python
from CoreGraphics import *
path = '/Users/foo/TEST.pdf'
print CGPDFDocumentCreateWithProvider(
        CGDataProviderCreateWithFilename(path)).getNumberOfPages()

Googling for coregraphics+python will no doubt turn up various stuff as well. Best place to ask for advice is the PythonMac SIG mailing list <http://mail.python.org/mailman/listinfo/pythonmac-sig>.

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

  • Prev by Date: Re: Modify python script, or best way to extract PDF pages?
  • Next by Date: Re: Address Book: why doesn't this work?
  • Previous by thread: Re: Modify python script, or best way to extract PDF pages?
  • Next by thread: Selecting your application using a file id
  • Index(es):
    • Date
    • Thread