-
Notifications
You must be signed in to change notification settings - Fork 22
Home
This project started as an attempt to find alternatives to some of the common tasks that I performed with Adobe Acrobat. Many of them were possible using Apple's Preview, but that has had very poor AppleScript support. Another alternative was Apple's Automator actions, but these were often slow, and lacking in features or flexibility. However, I learnt that some of these Automator actions had python scripts at their heart, and so I had a peek to see if I could use them and modify them. From there I discovered the joy of python and the PyObjC 'bridge' that allows anyone to program the MacOS APIs in python. The project has got dangerously out of hand since then.
Once I started to understand how you put together all Apple's objects and methods in the PDFKit and Core Graphics frameworks, it became very easy to create small bits of code that achieve pretty much anything that you can do with a PDF!
The next plan is to merge this project with something I've already done: My pswrite project is a pair of bash script 'CUPS backends' that can save PostScript or PDF files to disk from a print queue. I'm currently rewriting these in Python, so that I can create a print queue that saves PDF files and then further processes them with the code from PDFsuite: e.g. a print queue that saves all printed output as booklet PDFs; or with an 'embossed' letterhead or watermark; or even saving complete pages as hi-resolution TIFFs!
Future plans include one 'unified' pdfutil command line utility for MacOS and better error checking to cover any eventuality. But the quadruple pillars of PDF modification: from the print queue, from the PDF button of the print menu, from Finder's Quick Actions, and from the Terminal -- these remain the goals of the project.
One slight obstacle is the planned obsolescence of python 2. It will no longer be shipped with MacOS 10.16 (September 2020), meaning that users will have to install python 3 and PyObjC for the scripts and actions to function. (The scripts will have to be updated for compatibility with python 3.)
If there's anything particular you'd like to see, let me know.