Apply Quartz filter to a PDF from command line
Hello
I'm trying to apply a quartz filter to a PDF document via the command line. I know it's possible with Python and there's a script at /Developer/Examples/Quartz/Python/filter-pdf.py that does just that. The problem with this is that the script is Python 2.3 and my OS X 10.5.8 is running Python 2.5 - so I'm getting the error message:
+<Error>: The function `CGPDFDocumentGetMediaBox' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGPDFPageGetBoxRect' instead.+
I don't know Pyton but I checked the file and I grep'ed the Developer folder to see if I can find where CGPDFDocumentGetMediaBox is being used, but no matter what I changed, I didn't manage to get the script working.
So I guess my question is one of the following:
How can I update the developer example to a new, functioning version?
or how do I get rid of the deprecated functions that script is using?
or is there any other way to apply a quartz filter to a PDF via the command line? (I've read that SIPS is able to accomplish this, but I couldn't find out how..)
Thank you for any help!
Cheers
I'm trying to apply a quartz filter to a PDF document via the command line. I know it's possible with Python and there's a script at /Developer/Examples/Quartz/Python/filter-pdf.py that does just that. The problem with this is that the script is Python 2.3 and my OS X 10.5.8 is running Python 2.5 - so I'm getting the error message:
+<Error>: The function `CGPDFDocumentGetMediaBox' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGPDFPageGetBoxRect' instead.+
I don't know Pyton but I checked the file and I grep'ed the Developer folder to see if I can find where CGPDFDocumentGetMediaBox is being used, but no matter what I changed, I didn't manage to get the script working.
So I guess my question is one of the following:
How can I update the developer example to a new, functioning version?
or how do I get rid of the deprecated functions that script is using?
or is there any other way to apply a quartz filter to a PDF via the command line? (I've read that SIPS is able to accomplish this, but I couldn't find out how..)
Thank you for any help!
Cheers
Macbook white, Mac OS X (10.5.8), Python 2.3