Skip to content

Instantly share code, notes, and snippets.

@chrpinedo
Created April 4, 2016 10:27
Show Gist options
  • Save chrpinedo/a2a2af757e96aec0d6f69d707629a01a to your computer and use it in GitHub Desktop.
Save chrpinedo/a2a2af757e96aec0d6f69d707629a01a to your computer and use it in GitHub Desktop.
How to insert your signature in a PDF file by using PDFtk

How to insert your signature in a PDF file by using PDFtk

Your signature in all the sheets

  1. convert the signature image to PDF file
convert firma.png firma.pdf
  1. put firma.pdf in a A4 paper and try to correctly locate and size the signature
pdfjam --paper 'a4paper' --scale 0.3 --offset '-5cm -7.5cm' --outfile stamp.pdf firma.pdf
  1. join the original file and the signature file
pdftk original.pdf stamp stamp.pdf output final.pdf

Your signature in only one sheet

  1. convert the signature image to PDF file
convert firma.png firma.pdf
  1. put firma.pdf in a A4 paper and try to correctly locate and size the signature
pdfjam --paper 'a4paper' --scale 0.3 --offset '-5cm -7.5cm' --outfile stamp.pdf firma.pdf
  1. add blank sheets to stamp.pdf (you can use OpenOffice Write to create one PDF file with one blank file)
pdftk A=stamp.pdf B=blank.pdf cat A1 B1 output multistamp.pdf
  1. join the original file and the signature file
pdftk original.pdf multistamp multistamp.pdf output final.pdf
@jowagner
Copy link

jowagner commented Nov 1, 2017

To put the signature behind the content rather than on top, you can use pdftk background/multibackground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment