Re: Modify python script, or best way to extract PDF pages?
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