
Wipe $f.$ $f.$ $f.signed.pdf signature.pngĮcho "Signing document $f.pdf on page $page." Pagecount=$(pdftk $f.pdf dump_data | grep NumberOfPages | sed "s/.*: //") #dependencies: pdftk, ImageMagick, gpg, wipe, opensslīo=0.2 #baseline overlap in relation to y-size of the signature cleanup intermediate files containing the signature with wipe.only extract the specific page from the pdf file.overlay the signature with pdftk stamp to prevent image quality degradation.use stdbuf -oL and the -update option to have a live preview.

Luckily I found this question and the script of Emmanuel Branlard contains the idea on how to do it (with xv).

While putting my own signature commands into a shell script, I was looking for a way to interactively select the area where the signature should go. Network World: Using Gimp to modify PDF files.Instructables: Inserting an Image Into an Existing PDF And/or Converting Multiple Images to Pdf : 4 Steps.Text annotations and image additions to PDF file using free software.In the latter case i just print, sign, and scan again! See also Unfortunately this won't work if you need for example to sign every page of a multi page document. I do this regularly when i need to sign single page documents, and it takes me more or less five minutes. Open the signature on top of the document as a new layer (File -> Open as layer).Convert white to alpha in the signature if the background of the document is not white.Apply a threshold on the signature if the white is not white enough.

The latter is going to be in PDF format, that can be opened by Gimp
