2009-10-06

Stationary under Ubuntu

Nowadays instead of printing your business documents and sending by mail, in many cases people send PDF by email. What is missing here is usually the stationary paper that is taken from the printer tray where the comany headers and footers are pre-printed.

If you want to have a nice easy way for using or existing word processor templates adding a stationary PDF - here is what you can do:

Preparations:
sudo apt-get install nautilus-actions
sudo apt-get install pdftk

Then create a new action as:
Path: /bin/sh
Parameters: /home/username/stationary.sh '%d/%f'

And here is the content of script stationary.sh (don't forget to make it executable):
#!/bin/sh
pdftk "$1" background /home/username/stationary.pdf output "$1.new.pdf"
if [ -f "$1.new.pdf" ]
then
rm -f "$1"
mv "$1.new.pdf" "$1"
fi

And all what you need now is to put save your stationary as PDF to /home/username/stationary.pdf

Related post: Document file format, Virus scanning on Ubuntu.

1 comment:

Martin Wildam said...

With Ubuntu Karmic there came a change - at least it seems: When defining the parameters you need to omit the single quotation marks, so it must be:

/home/username/stationary.sh %d/%f