10.4: An Automator workflow to add an image to PDF files
Jan 24, '06 05:56:00AM
Contributed by: RubberDuck
My invoicing software is pretty basic when it comes to printing invoices. It cannot handle the graphics for my nicely-designed letterhead, so printing an invoice is a two-step process of printing the letterhead, and then sending the paper through again to print the actual invoice. But if I wanted to email the invoice, I was stuck typing the invoice details out again into a Word document containing the letterhead, to then print to PDF.
But now with Automator, once the invoice is printed to PDF from my invoicing program, I can add the graphics in a simple workflow. First I converted the letterhead layout to a Photoshop PSD file. Most common bitmap formats should suffice. My Automator workflow contains the following actions (the Library is listed first):
- Finder: Get Specified Finder Items.
- PDF: Watermark PDF. This is where the hard work is done. Add your bitmap file (for me, Letterhead.psd) to the Watermarks list. I found Offset of 0,0 and Scale 0.24 (for a 300dpi file) worked best for me.
- PDF: Compress Images in PDF Document. I used JPG compression.
- PDF: Rename PDF Document. Names the file with the PDF's Internal Title tag. In my case, it does not find a title, so it renames it Untitled.pdf, which is better than the random collection of letters it names the newly created PDF.
- Finder: Move Finder Items. I set it to move them to the Desktop, otherwise it will be somewhere unfriendly like /tmp.
- Finder: Rename Finder Items. I set 'Replace Text' with the "Show Action When Run" option ticked, so I can replace "Untitled" with something more meaningful.
- Finder: Label Finder Items. Red to help me find it on the Desktop.
Save all of this as a Finder plug-in (File: Save as Plug-In, which will save to your ~/Library -> Workflows -> Applications -> Finder directory). Once you've done that, you can then control-click (or right-click) on a PDF file and select Automator -> YourNewWorkflow to create your new PDF file with added image overlay.
Comments (6)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060118005354142