Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm often printing several versions of a document (e.g. a paper in progress). To keep track of the printouts I would like to print the date and time of printing onto each page, regardless of which application I'm using (although it would be okay if it works for PDF files only, if it happens automatically). I have seen Windows printer drivers including this feature, but haven't found any settings here (e.g., Canon iR3225) nor any hidden-CUPS-feature-I-could-activate-in-the-config-file.

Any ideas? Some sort of preprocessing I could inject into cups?

(I'm using Mac OS X 10.6.7)

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I finally found a usable solution using convert from ImageMagick, the PDF services mentioned by nathang and Automator.

  1. Start Automator, create a new "Print Plugin"
  2. Drag the "run shell script" action to the right and enter the following script:

    export PATH=/opt/local/bin:/usr/local/bin:$PATH
    convert -size 400x50 xc:white -font Arial -pointsize 24 -gravity center -draw "fill grey50 text 0,0 '`/bin/date`'" /tmp/stamp.png
    cat
    
  3. Add the "Watermark PDF Documents" action and add the file "/tmp/stamp.png" using the 'add...' button. (You probably have to create this file first, e.g. using touch /tmp/stamp.png in a Terminal). Then adjust the offset, scale and opacity as you like. I'm using x=480 y=820 scale=0.25 opacity=0.7.
  4. Add the "Open Images in Preview" action.
  5. Save the Automator script.

Now you should find a new action in the "PDF" drop-down menu of your printing dialog, which stamps the current date and time on each page and shows the result in Preview, from where you can print the document.

I uploaded my script to http://uploaded.to/file/5eiq7cg2 - you can simply download this to the /Library/PDF Services folder if you want.

share|improve this answer
add comment

Perhaps use a PDF modification tool like Pdftk to add a watermark that contains the desired metadata.

share|improve this answer
    
I know about pdftk, and probably it's possible using it to write some script adding my timestamp to each page. But this does not solve the integration problem into the printing system -- the solution is sort of unusable if I have to go to the console pre-processing every PDF file I want to print. –  tqx Jun 7 '11 at 11:19
    
How about integrating this with AppleScript? –  Alex Reynolds Jun 7 '11 at 17:30
    
Integrating into the system is the easy part, thanks to PDF services –  Nathan Grigg Jul 8 '11 at 2:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.