PDF forms on Linux

I will explain a method of filling in forms inside PDF documents for printing or saving (to send, for instance, a signed copy of a contract via e-mail). I’ve seen other methods described (see here), but I didn’t like any of them: most turn the PDF file into an image, which reduces quality and/or increases filesize, and pdfedit seems overly complicated.

Software required: gimp, pdftk.

First split the original pdf into separate pages (this is one disadvantage, pages need to be edited separately):

pdftk file.pdf burst

Next, for each page that needs changing (let’s call it page1.pdf), do the following:

Now, put the newly created pdf on top of the original page:

pdftk page1.pdf stamp stamp1.pdf

If your PDF was only one page, you’re done. Otherwise, you should join all pages together:

pdftk page1.pdf page2.pdf [...] cat output output.pdf

Now all you need is a high-quality copy of your signature :)