Monday, April 30, 2007

PDF electronic signature


Required tools:
  • imagemagick
  • pdftk

1. Split multi-page PDF into single pages.

#pdftk offer.pdf burst
#ls
pg_0001.pdf pg_0002.pdf pg_0003.pdf pg_0004.pdf


2. Convert the signature page to an image.

#convert -density 200 pg_0004.pdf pg_0004.png

Experiment with -density to get the best quality.


3. Sign a blank sheet of paper. Take a picture with a digicam. Edit the document image with your favourite image manipulation application (I used KolourPaint) and add your signature.


4. Convert the image back to PDF.

#convert pg_0004.png pg_0004_sig.pdf


5. Merge all pages into a single document.

#pdftk pg_0001.pdf pg_0002.pdf pg_0003.pdf pg_0004_sig.pdf cat output offer_sig.pdf