Skip to content

Instantly share code, notes, and snippets.

@hanchang
Forked from chrpinedo/insert-signature-in-pdf.md
Created September 20, 2020 01:46
Show Gist options
  • Save hanchang/5fdf399bcb4de8065d05fba0a4da96c8 to your computer and use it in GitHub Desktop.
Save hanchang/5fdf399bcb4de8065d05fba0a4da96c8 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment