Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

best method?




I have a small python script, which simply returns the number of pages of a pdf file. I want to include it in my project, and feed it the new path name each time I execute it.


My question / problem is, I don't really know the best way to get this script to work in my project? I assume there is a more correct way to do, or a better way, than what I'm thinking.

Here is the code for the script, which I found on Apple's list archives.. so thanks to whoever put this there!


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




any help would be appreciated.

wayne.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.