I am looking for a way to resize PDF files into multiple parts using Applescript. This alone is not that hard using sips or “Image Events”. But the problem with these two methods is that it seems to convert the original file into image files so that I cannot extract the text after the conversion. Does anyone have an idea on how to resize PDFs without losing the ability to extract the text afterwards?
One of our customers needed a second version of a PDF file used for printing to publish it on his website. This second version featured different crop marks, so I wrote a small command line utility in ObjC to create it. You can find the script code here, maybe it can help as a starting point.
Of course you will also be able to crop your PDF files with Adobe Acrobat and Apple-/JavaScript or with a utility like PDFClerk Pro, which is scriptable.
perhaps I have to say that I try this on an tiger-machine (10.4.11) …
gcc -o /Resources/croppdf /Resources/croppdf.m -Wall -g -framework Foundation -framework Quartz
got this error belonging to the Quraz-framework:
/Resources/croppdf.m:2: header file 'Quartz/Quartz.h' not found
/Resources/croppdf.m:15: undefined type, found `PDFDocument'
/Resources/croppdf.m:28: undefined type, found `PDFPage'
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode