265

I have a scanned copy of my written signature and I need to apply it to some documents in the signature block. I used to do this on Windows all the time but I now have only Linux.

Is this possible? How can I add a signature image to a PDF file in Linux (Gnome 3)?

DLight
  • 682
Freedom_Ben
  • 4,494
  • 2
    You can use Adobe Online Tool to easily sign without installing anything https://documentcloud.adobe.com/link/acrobat/fillsign?x_api_client_id=adobe_com&x_api_client_location=fillsign – Wenuka Aug 10 '21 at 14:19
  • 2
    This simple question and the plethora of answers below, most of which get it done with caveats and installing additional software is pretty much why I cannot recomment any distro to my folks. In MacOS you can just open the pdf with the document viewer, click on a button on the toolbar and either generate a signature on a x by x box which is immediatelly inserted in the document or import one. The distros should offer this functionality out of the box IMO. – George D Jan 31 '22 at 08:57
  • @Wenuka, I like this solution. However, do you know why my signature image (in blue) gets placed in the document as black & white only? I scanned my signature in blue ink, then made it transparent in Gimp, imported it in the Could Adobe, but when inserted in the document, it is only shown in black and white? Thanks again! – mgouin Apr 12 '23 at 18:22
  • I don't have enough rep to post an answer - but surprised that nobody has mentioned Firefox below – Mattwmaster58 Nov 15 '23 at 07:40

20 Answers20

311

Using Xournal (or Xournal++) you can annotate PDFs and add custom images (e.g. a transparent PNG). Although it is used for taking freehand notes and drawing, it can also annotate PDFs.

On Ubuntu:

  • Install Xournal through the Ubuntu Software Center
  • Open Xournal
  • Select "Annotate PDF" from the File menu and select your PDF file to be signed.
  • Click the "Image" button in the toolbar (it looks like a silhouette of a person).
  • Click on document. A file browser dialog will open.
  • Select a PNG image of your signature.
  • Resize and position the image on the PDF.
  • Select "Export to PDF" from the File menu.

More info at http://www.howtogeek.com/215485/sign-pdf-documents-without-printing-and-scanning-them-from-any-device/

Nate Lampton
  • 3,234
  • 17
    Xournal was really buggy - when I finally managed to import the signature and exported the PDF, the scanned PDF was blurred - my signature was the only crisp element on the resulting pdf. – Antti Haapala Jan 02 '17 at 22:00
  • 3
    I just did this on with xournal on arch and it worked quite nicely, but the background pdf was from a document, not a scan. maybe relevant? – Brandon Kuczenski Jul 03 '17 at 08:39
  • 1
    Worked for me as well on Ubuntu 16.04. As a sidenote, you can also use xournal to annotate the PDF by adding text on top of it in different layers (usefull for example to complete forms). – jotadepicas Sep 10 '17 at 00:52
  • hm. so this works, actually, but other pdf programs on mint don't save text fields... – mendota Apr 26 '18 at 17:47
  • 2
    As @AnttiHaapala discovered - this makes the resulting PDF very blurry. I can't recommend this method. – Adam Barnes Dec 16 '19 at 13:19
  • Wait. What exactly does "Select a PNG image of your signature" mean? Is a file dialog supposed to open after I "Click on document"? – Tom Russell Jan 10 '20 at 02:41
  • See https://askubuntu.com/questions/1000892/how-can-i-export-an-xoj-file-to-pdf-so-that-the-whole-file-is-exported-not-jus in case the exported pdf is not showing correctly – user1868607 Jul 16 '20 at 13:37
  • Doesn't work if PDF has a password – Philip Rego Aug 21 '20 at 00:05
  • I finally managed to do this in Xournal. On first try I could draw a signature, but was not able to add text. When retrying, drawing also didn't work anymore. One day later, I was able to draw, add text and export to PDF. So Xournal is buggy indeed – 7ochem Sep 17 '20 at 13:04
  • for some reason I am not able to resize and position the image... edit: never mind, i had to right click which was unexpected – Michael Dec 30 '20 at 21:02
  • Works well under Debian/sid, but Xournal doesn't seem to be able to keep the image ratio. So, instead of resizing the image, one can first zoom so that the inserted image has the right size. Another issue is that the exported PDF is rather big, but one can reduce it with ps2pdf, either directly or with my pdfcrush script to keep the metadata. – vinc17 Jan 03 '21 at 23:50
  • 7
    The answer should probably be updated to include xournalpp – insaner Jun 04 '21 at 04:08
  • I wasn't able to move or resize the signature after adding it. Had to disable XInput in the options menu. – MoRe Jan 17 '23 at 11:48
  • Using this solution with both xournal or xournal++ results in a PDF with links from original PDF no more working. – Benjamin Loison Mar 16 '23 at 01:00
  • When exporting to PDF, do not overwrite the input file, or you will only get the annotations. – Skippy le Grand Gourou Aug 02 '23 at 12:27
  • I do not experienced any blurring. It was also very easy to use. – Marco Sulla Oct 11 '23 at 15:26
75

I'm surprised to find the premier free office software for Linux mentioned nowhere on this page. LibreOffice Draw will open a PDF and allow you to insert an image. If your signature file already exists in the file system as a PNG with a transparent background, it's a snap to get it onto a page, change the size and move it into place in Draw. Draw will save the document as an ODG by default, so you'll need to export the modified document to PDF.

Tom Russell
  • 1,081
  • 1
  • 9
  • 13
  • 10
    It is worth nothing that this method does NOT turn the page into an image, so no potential quality losses are incurred on the final results. – davidovitch May 27 '20 at 10:14
  • It is also easy to add the date and the full name if needed – Pierre H. Jul 03 '20 at 12:41
  • It supports perfectly multipage PDF files (unlike another method I used before: importing one PDF page in Inkscape) – Pierre H. Jul 03 '20 at 12:43
  • 25
    I tried Draw with a PDF I had to insert a signature in, but it couldn't find the fonts used in the document, which were then substituted, and a lot of images looked warped. So I used Xournal instead and that worked perfectly in my case. – kasimir Aug 12 '20 at 09:03
  • Draw won't open my PDF – Philip Rego Aug 21 '20 at 00:02
  • 29
    LibreOffice Draw changes the format many fonts (probably fonts that are not available in the system). As a result text is overflowing the page borders. – Paul Rougieux Sep 04 '20 at 09:44
  • I think some software like Acrobat provides a way to embed font definitions into a PDF, if you have any control over its generation. – Tom Russell Oct 05 '20 at 06:20
  • This is tremendously useful. – Vincent Fourmond Dec 14 '20 at 10:31
  • 7
    Draw opens the PDF but increases the font size, making the document overlap with itself. No easy way to change the font. – drabus Dec 15 '20 at 10:31
  • 7
    This usually works for me, but today I opened a pdf file and random letters were capitalized and an image was completely annihilated. – Michael Dec 30 '20 at 20:57
  • I didn't even consider LibreOffice to be honest. It just didn't occur to me. I found it easier than using Xournal (but then I've never used Xournal, nor heard of it, before today). LibreOffice Draw worked like a treat. It'd be great if Evince could handle this like Apple Preview does. – Matthew Setter Jan 13 '21 at 14:00
  • 5
    as noted by others, LibreOffice often completely ruins the formatting of PDF files, which is not tolerable with official documents, so this is useless for such cases – gaspar Mar 08 '21 at 11:36
  • Just works, in my case. Rotation of text and signature image just fine. If it was an image to start with, no problem with fonts or whatnot. – Mike Hardy Dec 11 '21 at 22:44
  • 1
    Not good answer. LibreOffice doesn't open the PDF, it imports it and makes a (often poor poor) attempt to convert it to a LibreOffice Draw document. It's NOT intended to be a PDF editor. It will replace the embedded PDF font with a default one if it's not present on the system, it will try to approximately replicate formatting that are unsupported in it, and so on. Even if you manage to kind of make it work, you'll have a Draw document with little relationship to the original PDF. Don't do this. – Neinstein Jun 18 '22 at 19:32
35

A lot of people recommend Xournal, but i found it to work as a version of Gimp that i can't use.

Open PDF with GIMP and add the signature image

Thus if you are familiar with GIMP, i would recommend trying it.

  • You should have a file with the signature (even a picture taken with the phone or webcam), and a file with the document to be signed. The latter is going to be in PDF format, that can be opened by Gimp
  • Apply a threshold on the signature if the white is not white enough
  • Convert white to alpha in the signature if the background of the document is not white
  • Open the document with Gimp
  • Open the signature on top of the document as a new layer (File -> Open as layer)
  • Adjust size and position
  • Merge layers
  • Export as PDF

Personal Experience

I do this regularly when i need to sign single page documents, and it takes me more or less five minutes. Unfortunately this won't work if you need for example to sign every page of a multi page document. In the latter case i just print, sign, and scan again!

See also

hc_dev
  • 131
danza
  • 451
  • 3
    I tried all the above solutions, they all failed after much effort. xournal doesn't really work properly, there seem to be bugs in it's user interface and I wasn't able to scale or move the images after I imported them. xv did not compile, requires numerous patches to C code, then finally doesn't work either. updf, or its ubuntu PPA, doesn't exist anymore afaict. (tested on ubuntu xenial dec 2016) gimp is the way to go, thanks for this! – Chris Beck Dec 12 '16 at 21:04
  • 3
    This is a beautiful solution! It does require some image editing skills to create the signature with a transparent background, and to scale the image when added to the document as a layer. BTW, the date can also be added to the working XCF file as a layer with a bit of fuss (text size and location). The resulting PDF export is quite acceptable! – Tom Russell Jun 12 '18 at 17:53
  • 7
    If the document has multiple pages: import page as layers (default option), save the document as ".mng" (means multiple png) just adding .mng extensions and "export as" option on gimp, now got to command line and do: convert original_name.mng output_name.pdf. That's all. By the way, if the resolution for output is low, try enlarge size of pdf images while importing the pdf at the begining: try something like "2000" for width. When exporting to MNG dont forget to check the option "compression level" to the maximum this way final file will not be too heavy. – Diego Andrés Díaz Espinoza Sep 24 '18 at 18:05
  • This answer along with this (https://onlinesignature.com/es/draw-a-signature-online) is all you need – Alfergon Aug 28 '19 at 16:03
  • 9
    The main issue with this solution is that it renders the PDF as an image. If the original PDF had embedded text that can be selected and copied, or forms - these are all lost. So it is a good option if the source is a scanned image PDF, but if you want to retain non-image PDF features on the source - use Xournal. Also - the default rendering resolution of PDFs in GIMP is 100 ppi, which is very low and results in blurred text - use at least 600. – Guss Jul 05 '20 at 12:19
  • The problem with GIMP is it makes the PDF an image. Then the texts are not selectable and not parsable afterwards. – Shiplu Mokaddim Nov 26 '20 at 13:19
  • This worked perfectly even with multi page pdfs, just check the checkbox Layers as Pages in the save dialog. – Manuel Manhart Aug 19 '22 at 10:46
24

Since some users mentioned bugs in the output file (crisp signature but blurred source document), I suggest using xournalpp (xournal++) instead of xournal. I’ve not encountered any problem.

It’s packaged in some distributions (in Arch, pacman -Ss xournal only shows xournalpp) and works as intended.

From Arch Wiki:

Xournal++ (xournalpp) is the successor to Xournal that is currently in development. If you want a newer version Xournal, then you could try this. It is currently stable with little to no bugs that causes crashes.

Link to repository: https://github.com/xournalpp/xournalpp

Philipp
  • 549
13

It's worth mentioning Xournal which has a nice UI and allows adding text, images, and hand-written notes to PDF files. The only problem I've had is it doesn't seem to handle text from native PDF forms very well.

9

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. Luckily I found this question and the script of Emmanuel Branlard contains the idea on how to do it (with xv). I implemented the following points:

  • use ImageMagicks display instead of xv
  • use stdbuf -oL and the -update option to have a live preview
  • overlay the signature with pdftk stamp to prevent image quality degradation
  • only extract the specific page from the pdf file
  • decrypt the signature with gpg
  • encrypt the signed pdf file with pdftk
  • cleanup intermediate files containing the signature with wipe

So here is the code:

#!/bin/env zsh

#dependencies: pdftk, ImageMagick, gpg, wipe, openssl

signature=~/PGP/signature.png.gpg

f=${1%.pdf}
page=$2
density=144
bo=0.2 #baseline overlap in relation to y-size of the signature

pagecount=$(pdftk $f.pdf dump_data | grep NumberOfPages | sed "s/.*: //")
#sign on last page by default
if [ -z "$page" ]; then page=$pagecount; fi

function cleanup
{
    echo "Cleaning up..."
    rm $f.$page.pdf
    wipe $f.$page.signature.pdf $f.$page.signed.pdf $f.signed.pdf signature.png
}
trap cleanup EXIT

echo "Signing document $f.pdf on page $page."

echo "Decrypting signature..."
gpg -d $signature > signature.png
identity=$(identify -format "%w,%h,%x,%y" signature.png)
sdata=(${(s/,/)identity})

echo "Please give the signature area with two clicks and finish by pressing ‘q’!"

#extract page
pdftk $f.pdf cat $page output $f.$page.pdf
cp $f.$page.pdf $f.$page.signed.pdf
size=$(identify -format "%wx%h" $f.$page.pdf)

#select signature area
display -density $sdata[3]x$sdata[4] -immutable -alpha off -update 1 -debug X11 -log "%e" -title "sign $f.pdf#$page" $f.$page.signed.pdf 2>&1 >/dev/null | \
    grep --line-buffered "Button Press" | \
    stdbuf -oL sed -r "s/^.*\+([0-9]+)\+([0-9]+).*$/\1,\2/" | \
    while read line
do
    p1=($p2)
    p2=(${(s/,/)line})

    if [ -n "$p1" ]
    then
        p=(0 0)
        if (( p1[1] < p2[1] )); then dx=$((p2[1]-p1[1])); p[1]=$p1[1]; else dx=$((p1[1]-p2[1])); p[1]=$p2[1]; fi
        if (( p1[2] < p2[2] )); then dy=$((p2[2]-p1[2])); p[2]=$p1[2]; else dy=$((p1[2]-p2[2])); p[2]=$p2[2]; fi
        dy=$((dy*(1+bo)))

        if (( $dx*$sdata[2] > $sdata[1]*$dy ))
        then
            resize=$(((dy+0.0)/sdata[2]))
            p[1]=$((p[1]+(dx-resize*sdata[1])/2))
        else
            resize=$(((dx+0.0)/sdata[1]))
            p[2]=$((p[2]+(dy-resize*sdata[2])/2))
        fi

        echo "Inserting signature..."
        convert -density $density -size $size xc:transparent \( signature.png -resize $((resize*100))% \) -geometry +$p[1]+$p[2] -composite $f.$page.signature.pdf
        pdftk $f.$page.pdf stamp $f.$page.signature.pdf output $f.$page.signed.pdf

        unset p1 p2
    fi
done

if [ -z "$p" ]
then
    echo "You have to click two times. Aborting..."
    exit 1
fi

echo "Joining PDF pages..."
sew=( pdftk A=$f.pdf B=$f.$page.signed.pdf cat )
if (( page > 1 )); then
    sew+=A1-$((page-1))
fi
sew+=B
if (( page < pagecount )); then
    sew+=A$((page+1))-end
fi
sew+=( output $f.signed.pdf )
$sew

echo "Encrypting PDF file..."
pdftk $f.signed.pdf output $f.signenc.pdf user_pw PROMPT owner_pw $(openssl rand -base64 32) allow AllFeatures
bodo
  • 183
8

I found this script which you can modify to attach a signature to an existing PDF file.

You can also download it from this pastebin URL:

There is also this Q&A on AskUbuntu that has many other methods for doing this. The Q&A is titled: How to put a picture on an existing pdf file?.

slm
  • 369,824
  • @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK. – slm Aug 07 '13 at 22:44
  • 4
    The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :) – odinho - Velmont Jun 04 '14 at 11:11
  • @Velmont - commands w/in the script could be modified to improve the quality. – slm Jun 04 '14 at 11:14
  • 4
    @slm: Very true. But it still creates a /picture/ of the page, instead of only stamping the image on like updf does. pdftk is also able to do such operations, but would need a driver-script like the one here. – odinho - Velmont Jun 04 '14 at 11:16
  • @Velmont - yes, that is an annoyance with many of the approaches I've seen w/ working w/ PDFs. I believe there were some Q's around working with the PDF format directly as opposed to as images on this site. LMK if you're interested I can help dig them up. Look for Q&A's related to myself or Gilles. – slm Jun 04 '14 at 11:25
  • 2
    I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): http://stackoverflow.com/questions/356502/how-to-do-mail-merge-on-top-of-a-pdf -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there. – odinho - Velmont Jun 04 '14 at 12:07
  • +1 for your link to AskUbuntu. – erik Jul 09 '14 at 15:46
  • 3
    Is there a version of this that does not use xv? It is too difficult to install xv and it's not free software... – Chris Beck Dec 12 '16 at 19:09
6

Okular PDF viewer has this built-in with annotations. Open the PDF you want to sign, select reviews on the bar to the left, select the third option on the pop up menu that says, 'freehand line.' Draw out your signature. If you want it black ink rather then neon green, select 'Settings' from the menu, select 'Configure Okular,' select 'Annotations' button on the left. Select 'Freehand Line' from the options, then select the 'Edit' button. You can adjust both the line thickness and color here. Hit Apply and enjoy.

Christian
  • 61
  • 1
  • 2
  • In my case I also need to "tick" menu item "Tools" -> "Review" to see "Freehand Line" and "Inline Note" (add normal text) menu. And I can right-click the thing I draw and choose "Properties" to edit color, set border width to 0, set Align "center", and drag the line to adjust border height. – 林果皞 Mar 31 '20 at 13:50
  • 3
    With Okular, you can also have and use your signature stamp. You can even sign a pdf properly, using a certificate. The official information is on https://docs.kde.org/stable5/en/okular/okular/signatures.html. – Ganton Oct 12 '21 at 11:23
6

I've had a reasonably good experience with uPdf.

Installation

sudo add-apt-repository ppa:atareao/updf
sudo apt-get update
sudo apt-get install -y updf

Then fix a bug by editing 2 lines in a Python script.

Usage

Launch uPdf, select the Add an image tool, draw a rectangle around the area where you want the signature to go and select the image file with your signature. A PNG with a transparent background works best.

kynan
  • 225
  • 9
    lol, that's so funny about the editing 2 lines of Python. Because I'm the one who created that comment. And here I am looking for a way to sign a PDF again, so happy about helpful people on the intarwebs :) – odinho - Velmont Jun 04 '14 at 11:12
  • Looks like the last release was for Ubuntu Quantal. Adding the repo on 15.04 (Vivid) errors with "Failed to fetch ..." – Ponkadoodle Jun 16 '15 at 20:20
  • @Wallacoloo The package is only built for Raring and Saucy. For any other distribution you need to manually change the distribution in the lst file created in /etc/apt/sources.list.d. – kynan Jun 16 '15 at 22:31
  • Crashes after splash screen on Wily 15.10 using either Precise or Quantal distributions. – Coder Guy Jan 06 '16 at 01:33
  • 1
    Works for me on Debian Buster. Other answers like the custom scripts use pdftk which is currently unavailable, and Xournal is not in the repositories. Updf download page or direct download link. Install with sudo dpkg -i file.deb; sudo apt install -f and then edit the Python code as mentioned in the answer. – Luc Jul 06 '18 at 10:38
5

On Debian (Bullseye) I've found the simplest (?) free way is to use Scribus 1.5.5 which can easily import a PDF (this may be possible in earlier releases, too):

Import the PDF, then make an image box where you want your signature, choose your signature file, resize as necessary and then export as a new PDF (of course, you can use a text box to place necessary text such as date etc.) It's no different ultimately to using GIMP or similar, but if you're familiar with Scribus then it's a matter of seconds to do it. I've just done it twice for signing off accounts, which is how I ended up here ;)

4

For completeness, there is an alternative script to do this, which does not convert the pdf to a (low quality) image, in contrast to the one mentioned so far: https://github.com/martinruenz/signpdf

My experience with the other solutions was:

  • Xournal messed with the pdf (it seemed to work after building from source though)
  • The script SignPDF converts pdfs to images and reduces quality significantly. It also has a troublesome dependency (xv)
  • I didn't try the gimp and updf option
  • In the end I used Acrobat Reader in a VM as I also had to fill various forms
Martin R.
  • 141
  • Thanks for sharing back. I'll check out your script. I've had really good success with Xournal, tho you have to make sure not to export to the original filename as that can cause issues. If you pick a new name to export to (so you aren't overwriting the original pdf) then you'll avoid this bug. – Freedom_Ben Jun 09 '18 at 03:15
  • That doesn't solve the blurriness issue @Freedom_Ben – Adam Barnes Dec 16 '19 at 13:21
4

Inspired by the answer from bodo I created a simplified version in hope others can reuse/modify this easily for their purpose to sign a single page pdf. I'm not sure if this might also work for multipage pdf's.

Save the following script as sign.sh. Given some pdf called origin.pdf you want to add an image, e.g. a png of your signature, somewhere in the pdf, you run the script like this:

./sign.sh origin signature.png 10 400 690
This command creates a new pdf origin.1.signed.pdf where the signature.png is scaled to 10% of it's size and positioned to 400x690 in the pdf.

#!/bin/bash -x

density=144

f=$1 s=$2 p=$3 x=$4 y=$5

determine the size of the original pdf

pdfsize=$(identify -format "%wx%h" "$f.pdf")

just in case someone needs this: get the size of the signature image

#identify -format "%w,%h,%x,%y" "$s"

create a new pdf with the same size as the original pdf with transparent background and the signature image positioned at the final position

convert -density $density -size $pdfsize xc:transparent ( "$s" -resize $p% ) -geometry +$x+$y -composite "$f.1.signature.pdf"

stamp the original pdf with the new signature template pdf

pdftk "$f.pdf" stamp "$f.1.signature.pdf" output "$f.1.signed.pdf"

remove the signature pdf

rm "$f.1.signature.pdf"

John Doe
  • 199
2

Most answers here will rasterize the signature and/or the document. I prefer a solution with is as least invasive as possible, not changing the document (text, fonts, kerning,…) except for the added signature.

  1. Create a document with the same page-size containing only the signature in the target location.
    I like to use Inkscape (I just imported the page I want to sign, placed the signature, remove the imported parts, saved the page as PDF). Others like to use enscript.
  2. Overlay the signature onto the document.
    qpdf document.pdf --overlay signature.pdf -- signed_document.pdf

This assumes a one-page document, signature shall be placed on that one page. For alternative variants, have a look at this answer.

Hermann
  • 6,148
1

Here's a solution that preserves the PDF layout, the text, and forms.

  1. Open the original PDF file orig.pdf with Xournal.
  2. Add the signature as an image (and possibly other things) with Xournal.
  3. Still in Xournal, select "Page → Apply To All Pages", then "Page → Page Style → plain" (this will remove everything from the original PDF file). Then export to PDF, say as signature.pdf. The goal here is to keep only the data added in Xournal (e.g. the signature).
  4. Remove the background from signature.pdf in a similar way to what is said in How to change white background of an included PDF to transparent. In short: qpdf -qdf signature.pdf tmp.pdf, then remove each occurrence of the data consisting of 4 numbers followed by "re f". But to fix the obtained PDF, instead of using fix-qdf, I suggest to use ps2pdf tmp.pdf new-signature.pdf (ignore the error) in order to also recompress the PDF file.
  5. Add the signature to the original file with: pdftk orig.pdf multistamp new-signature.pdf output result.pdf

The obtained PDF file result.pdf has the contents from orig.pdf (including the forms) and the signature (and possibly other data that were added with Xournal) from new-signature.pdf.

Note: this should also work with Xournal++ instead of Xournal.

vinc17
  • 12,174
0

Let me start from the beginning of the question which mentions a "scanned copy of my written signature". I used a picture taken with my phone. By the way, I recommend using ink or a strong black pen to make sure the written portion has clear lines that stand out from the white paper background.

Step 1 - Make a transparent signature image

You'll only need to do this once. For this I used gimp, which you can install on Ubuntu with:

sudo apt install gimp

You might want to start by getting a nice rectangle with only the signature. For this I used the Rectangle Select Tool, then Edit > Cut, and Edit > Paste as New Image.

Next I followed the steps to make the background transparent by using the Fuzzy Select Tool and pressing Delete. This gets rid of the white background (important because in my case the picture didn't come out with a clear white, was more like grey) leaving only the black signature. I then exported this to a PNG file. Now I have a signature file that I can reuse!

Step 2 - Insert Signature in PDF

Once you have a transparent signature it makes it easier to use a variety of tools. I used GIMP again. I was given a Word document so I used LibreWriter to convert it to a PDF first. Then I opened it with GIMP and accepted the default of each page as a layer.

Next I opened the signatured file using File > Open as Layers. I used CTRL+S to resize it and then the Move Tool to position it nicely on the page. Then I right-clicked on the signature layer on the right and selected "Merge Down".

The final step was to use "File > Export as" and giving the file name a PDF extension. In the options dialog I accepted the default of "use layers as pages" and also had to tick "reverse page order" to get the order page right.

Note: I had done this before on Windows and it was a lot easier with Acrobat Reader, because I already had the transparent image. Although the Linux method is a bit more involved, it's not that much more complicated if you follow the steps, once you have a transparent PNG. Any suggestion for improving this answer is welcome.

Nagev
  • 439
0

Inspired by bodo's answer I went ahead and wrote a tool with a complete GUI that won't reduce the output quality.

Here it is:

https://github.com/svenssonaxel/pdf-sign

0

I have just finished putting together an early version of a tool that makes it quite easy to draw anything you can in Inkscape and overlay it onto pages of PDF. It's a GUI app for linux written in Go:

https://github.com/oxplot/pdfrankestein

Mansour
  • 261
0

The problem with the xournal solution is it is not working with the signature was produced via a scan, as setting the background to transparent does not work properly. Unfortunately with xournal it is also not possible to set the signature image into the background. SO the best solution in my opinion that always works is to:

Do it online with adobe acrobat reader...

https://acrobat.adobe.com/link/home/

Create an account, upload your pdf document, open the document and then select signature and upload your signature .png file.

enter image description here

Then place the signature in your document.

  • Please add some sort of explanation as to what that online service can do and what the workflow would be to address the OPs problem of "stamping" (several) PDF documents with a signature bitmap. – AdminBee Sep 01 '22 at 13:31
0

LibreOffice Draw worked very well for me.

progonkpa
  • 153
-1

updf is really good for this. Having used preview on MacOS to "sign" documents, updf offers the closest user experience to this.

The following works on Ubuntu 14.10 and Debian 8.

I didn't want to add a third party ppa to my system, so got updf running in the following way instead:

$ bzr branch lp:updf

then made the 2 line edit as referenced from the other answer.

Install dependencies:

# apt-get install python-poppler gir1.2-gtk-3.0 gir1.2-gdkpixbuf-2.0 gir1.2-poppler-0.18 python-cairo librsvg2-2 gir1.2-rsvg-2.0 python-gi-cairo

(the above was sufficient; not every package may be necessary, though).

and then the python program is runnable in-place:

$ ./src/updf.py

Unfortunately, quality can be severely affected in the output document compared to the input document. The right way to do this would be to overlay the signature, and not change the original, in a lossless process. Whereas updf appears to engage in re-encoding of the original.

Kusalananda
  • 333,661
projix
  • 179
  • 6