Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: An Automator workflow to add an image to PDF files System 10.4
Tiger only hintMy 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):
  1. Finder: Get Specified Finder Items.
  2. 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.
  3. PDF: Compress Images in PDF Document. I used JPG compression.
  4. 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.
  5. Finder: Move Finder Items. I set it to move them to the Desktop, otherwise it will be somewhere unfriendly like /tmp.
  6. 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.
  7. 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.
    •    
  • Currently 3.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[23,478 views]  

10.4: An Automator workflow to add an image to PDF files | 6 comments | Create New Account
Click here to return to the '10.4: An Automator workflow to add an image to PDF files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
TimeEqualsMoney from www.stone.com
Authored by: Harry Boner on Jan 24, '06 07:25:01AM

Nice work around.

You might just want to purchase TimeEqualsMoney from www.stone.com. Does all this and more. Great for time keeping and invoicing.



[ Reply to This | # ]
10.4: An Automator action to add an image to PDF files
Authored by: Arlo on Jan 24, '06 07:26:35AM

This is a workflow, not an action. The headline should be corrected.

---
www.automatorworld.com
"Better Living Through Macintosh Scripting"



[ Reply to This | # ]
Use OmniGraffle to do similar
Authored by: tuggle on Jan 24, '06 10:35:27AM

I've used OmniGraffle to do that and other similar tasks, such as filling out a PDF form (when it's not actually a fillable-out PDF form!)

Launch OmniGraffle and drag in any PDF file you want. It comes up as a transparent object. You can then do anything else you can do in OmniGraffle, such as drag in other PDF files, or place text, lines, or shapes over/under/around it.

I've used this technique to generate very professional looking markup/comments/annotations to PDF files, or to fill out PDF forms. Very handy.

Caveat: I haven't dragged in any mutti-page PDF files into OmniGraffle... it may not work well. (I don't know)



[ Reply to This | # ]
10.4: An Automator action to add an image to PDF files
Authored by: Eddie the Elder on Jan 29, '06 12:04:31PM

There's actually an even simpler way, you can do the whole thing in one step from the Print dialog. Create a workflow with the following actions:

Action 1. Watermark PDF (with your choice of watermark image and offset, etc.)
Action 2. Print Images

Now save this workflow in /Library/PDF Services or in ~/Library/PDF Services with a name such as "Print with Watermark.workflow".

This workflow will now become available in the "PDF" drop-down button/menu in all Print dialogs, so when you go to print from your invoice application, you just select this workflow in the Print dialog and you're done.



[ Reply to This | # ]
10.4: An Automator action to add an image to PDF files
Authored by: pxlpushr on Jan 31, '06 12:28:11PM

Cool fix, thanks!
1 question: does this only work with 'default printer'?
i have several printers (local and network). i set up the "Action 2. Print Images" with a printerA (which is not the default) and i get an lpr: error. but if i make printerA the default and set up the Action 2 to 'default', it will work.
:: this is my first attempt at actions and workflows, hope this makes sense.



[ Reply to This | # ]
10.4: An Automator action to add an image to PDF files
Authored by: Eddie the Elder on Jan 31, '06 04:05:23PM
i have several printers (local and network). i set up the "Action 2. Print Images" with a printerA
If I set up the workflow the way you did (specifying a different printer in Action 2) then I get the error also. However, you can leave Action 2 set to "Default Printer" and simply choose the printer you want on the fly in the Print dialog and that seems to work okay.

[ Reply to This | # ]