How can I add a signature .png to a PDF in Linux?How to know if a PDF file is compressed or not and to...

Symplectisation as a functor between appropriate categories

Why isn't there any 9.5 digit multimeter or higher?

Pointwise convergence of uniformly continuous functions to zero, but not uniformly

Why is the number of local variables used in a Java bytecode method not the most economical?

How much were the LMs maneuvered to their landing points?

Which approach can I use to generate text based on multiple inputs?

Am I allowed to use personal conversation as a source?

Is there a reason why I should not use the HaveIBeenPwned API to warn users about exposed passwords?

Is there an antonym for "spicy" or "hot" regarding food (NOT "seasoned" but "spicy")?

Suggestions for protecting jeans from saddle clamp bolt

How to check what is edible on an alien world?

Is it legal for private citizens to "impound" e-scooters?

How could Nomadic scholars effectively memorize libraries worth of information

Old French song lyrics with the word "baiser."

How to avoid theft of potentially patentable IP when trying to obtain a Ph.D?

Decreasing star count

Did the meaning of "significant" change in the 20th century?

Why does Canada require mandatory bilingualism in all government posts?

The Sword in the Stone

How do I explain an exponentially complex intuitively?

What is the most efficient way to write 'for' loops in Matlab?

How to get CPU-G to run on 18.04

Checking if an integer is a member of an integer list

Is it legal to use cash pulled from a credit card to pay the monthly payment on that credit card?



How can I add a signature .png to a PDF in Linux?


How to know if a PDF file is compressed or not and to (un)compress itconvert pdf to image [jpeg|png]How can I print half of a page to a pdf file?How can I convert a scanned PDF with OCRed text to one without OCRed text?How can this pdf file be created from this website?Is conversion between images and a text PDF possibleHow to resize content of PDF without affecting page size?How to print to PDF while appending to an existing document?Light pdf reader that can open multiple copies of a pdf with annotations and highlightingCommand line: How do you rotate a PDF file 90 degrees?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







56















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)?










share|improve this question































    56















    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)?










    share|improve this question



























      56












      56








      56


      20






      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)?










      share|improve this question
















      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)?







      pdf evince






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 7 '13 at 23:32









      Gilles

      566k136 gold badges1166 silver badges1676 bronze badges




      566k136 gold badges1166 silver badges1676 bronze badges










      asked Aug 7 '13 at 20:04









      Freedom_BenFreedom_Ben

      8742 gold badges14 silver badges20 bronze badges




      8742 gold badges14 silver badges20 bronze badges






















          10 Answers
          10






          active

          oldest

          votes


















          71














          Using 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.

          • 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/






          share|improve this answer





















          • 7





            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 2 '17 at 22:00






          • 1





            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 3 '17 at 8:39













          • 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 0:52











          • hm. so this works, actually, but other pdf programs on mint don't save text fields...

            – mendota
            Apr 26 '18 at 17:47





















          9














          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.






          share|improve this answer































            8














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




            • http://emmanuel.branlard.free.fr/work/linux/dev/SignPDF/SignPDF


            You can also download it from this pastebin URL:




            • http://pastebin.com/9TL5pvBA


            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?.






            share|improve this answer


























            • @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

              – slm
              Aug 7 '13 at 22:44








            • 3





              The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

              – odinho - Velmont
              Jun 4 '14 at 11:11








            • 2





              @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 4 '14 at 11:16






            • 1





              I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

              – odinho - Velmont
              Jun 4 '14 at 12:07






            • 2





              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



















            7














            A lot of people recommend Xournal, but i found it to work as a version of Gimp that i can't use. 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


            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!






            share|improve this answer





















            • 2





              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








            • 1





              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






            • 1





              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



















            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.






            share|improve this answer





















            • 4





              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 4 '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.

              – Jonathan Neufeld
              Jan 6 '16 at 1:33











            • 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 6 '18 at 10:38





















            4














            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





            share|improve this answer
























            • This isn't working for me, imagamagick loads but only displays splash screen.

              – Andreas
              Jul 27 '16 at 20:41



















            2














            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






            share|improve this answer
























            • 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 9 '18 at 3:15





















            1














            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.






            share|improve this answer































              0














              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.






              share|improve this answer


























              • I had to add python-gi-cairo to the dependencies to make it work.

                – Joma
                Mar 18 '15 at 7:07











              • Joma: thanks; I've now added python-gi-cairo to the list.

                – projix
                Jun 5 '16 at 20:01





















              0














              I had trouble with LibreOffice Draw (the PDF itself got corrupted, due to the original not being perfect) and GIMP (it seemed to hang), but FoxitReader worked well. After opening the PDF, I could type in the date and name, and then use "PDF sign" to add an image.






              share|improve this answer








              New contributor



              Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "106"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f85873%2fhow-can-i-add-a-signature-png-to-a-pdf-in-linux%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                10 Answers
                10






                active

                oldest

                votes








                10 Answers
                10






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                71














                Using 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.

                • 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/






                share|improve this answer





















                • 7





                  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 2 '17 at 22:00






                • 1





                  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 3 '17 at 8:39













                • 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 0:52











                • hm. so this works, actually, but other pdf programs on mint don't save text fields...

                  – mendota
                  Apr 26 '18 at 17:47


















                71














                Using 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.

                • 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/






                share|improve this answer





















                • 7





                  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 2 '17 at 22:00






                • 1





                  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 3 '17 at 8:39













                • 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 0:52











                • hm. so this works, actually, but other pdf programs on mint don't save text fields...

                  – mendota
                  Apr 26 '18 at 17:47
















                71












                71








                71







                Using 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.

                • 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/






                share|improve this answer















                Using 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.

                • 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/







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 11 at 10:36









                rofrol

                1315 bronze badges




                1315 bronze badges










                answered Aug 24 '15 at 22:43









                Nate LamptonNate Lampton

                8266 silver badges3 bronze badges




                8266 silver badges3 bronze badges








                • 7





                  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 2 '17 at 22:00






                • 1





                  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 3 '17 at 8:39













                • 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 0:52











                • hm. so this works, actually, but other pdf programs on mint don't save text fields...

                  – mendota
                  Apr 26 '18 at 17:47
















                • 7





                  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 2 '17 at 22:00






                • 1





                  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 3 '17 at 8:39













                • 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 0:52











                • hm. so this works, actually, but other pdf programs on mint don't save text fields...

                  – mendota
                  Apr 26 '18 at 17:47










                7




                7





                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 2 '17 at 22:00





                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 2 '17 at 22:00




                1




                1





                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 3 '17 at 8:39







                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 3 '17 at 8:39















                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 0:52





                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 0:52













                hm. so this works, actually, but other pdf programs on mint don't save text fields...

                – mendota
                Apr 26 '18 at 17:47







                hm. so this works, actually, but other pdf programs on mint don't save text fields...

                – mendota
                Apr 26 '18 at 17:47















                9














                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.






                share|improve this answer




























                  9














                  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.






                  share|improve this answer


























                    9












                    9








                    9







                    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.






                    share|improve this answer













                    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.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 12 '15 at 15:21









                    Mike ChelenMike Chelen

                    1911 silver badge1 bronze badge




                    1911 silver badge1 bronze badge























                        8














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




                        • http://emmanuel.branlard.free.fr/work/linux/dev/SignPDF/SignPDF


                        You can also download it from this pastebin URL:




                        • http://pastebin.com/9TL5pvBA


                        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?.






                        share|improve this answer


























                        • @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

                          – slm
                          Aug 7 '13 at 22:44








                        • 3





                          The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

                          – odinho - Velmont
                          Jun 4 '14 at 11:11








                        • 2





                          @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 4 '14 at 11:16






                        • 1





                          I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

                          – odinho - Velmont
                          Jun 4 '14 at 12:07






                        • 2





                          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
















                        8














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




                        • http://emmanuel.branlard.free.fr/work/linux/dev/SignPDF/SignPDF


                        You can also download it from this pastebin URL:




                        • http://pastebin.com/9TL5pvBA


                        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?.






                        share|improve this answer


























                        • @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

                          – slm
                          Aug 7 '13 at 22:44








                        • 3





                          The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

                          – odinho - Velmont
                          Jun 4 '14 at 11:11








                        • 2





                          @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 4 '14 at 11:16






                        • 1





                          I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

                          – odinho - Velmont
                          Jun 4 '14 at 12:07






                        • 2





                          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














                        8












                        8








                        8







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




                        • http://emmanuel.branlard.free.fr/work/linux/dev/SignPDF/SignPDF


                        You can also download it from this pastebin URL:




                        • http://pastebin.com/9TL5pvBA


                        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?.






                        share|improve this answer















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




                        • http://emmanuel.branlard.free.fr/work/linux/dev/SignPDF/SignPDF


                        You can also download it from this pastebin URL:




                        • http://pastebin.com/9TL5pvBA


                        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?.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Apr 13 '17 at 12:22









                        Community

                        1




                        1










                        answered Aug 7 '13 at 20:23









                        slmslm

                        265k73 gold badges573 silver badges716 bronze badges




                        265k73 gold badges573 silver badges716 bronze badges













                        • @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

                          – slm
                          Aug 7 '13 at 22:44








                        • 3





                          The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

                          – odinho - Velmont
                          Jun 4 '14 at 11:11








                        • 2





                          @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 4 '14 at 11:16






                        • 1





                          I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

                          – odinho - Velmont
                          Jun 4 '14 at 12:07






                        • 2





                          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



















                        • @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

                          – slm
                          Aug 7 '13 at 22:44








                        • 3





                          The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

                          – odinho - Velmont
                          Jun 4 '14 at 11:11








                        • 2





                          @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 4 '14 at 11:16






                        • 1





                          I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

                          – odinho - Velmont
                          Jun 4 '14 at 12:07






                        • 2





                          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

















                        @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

                        – slm
                        Aug 7 '13 at 22:44







                        @Freedom_Ben - also if you're interested I found how to sign your PDFs using certificates instead of just a PNG. LMK.

                        – slm
                        Aug 7 '13 at 22:44






                        3




                        3





                        The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

                        – odinho - Velmont
                        Jun 4 '14 at 11:11







                        The problem is that it creates images of the pages in very bad quality. :/ The other answer (about updf) works better. :)

                        – odinho - Velmont
                        Jun 4 '14 at 11:11






                        2




                        2





                        @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 4 '14 at 11:16





                        @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 4 '14 at 11:16




                        1




                        1





                        I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

                        – odinho - Velmont
                        Jun 4 '14 at 12:07





                        I've used pdftk and reportlab to do similar things before (mail merge on top of pdf): stackoverflow.com/questions/356502/… -- took lots of effort to find out an effective way. Very many bad ways to process PDFs out there.

                        – odinho - Velmont
                        Jun 4 '14 at 12:07




                        2




                        2





                        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





                        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











                        7














                        A lot of people recommend Xournal, but i found it to work as a version of Gimp that i can't use. 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


                        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!






                        share|improve this answer





















                        • 2





                          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








                        • 1





                          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






                        • 1





                          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
















                        7














                        A lot of people recommend Xournal, but i found it to work as a version of Gimp that i can't use. 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


                        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!






                        share|improve this answer





















                        • 2





                          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








                        • 1





                          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






                        • 1





                          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














                        7












                        7








                        7







                        A lot of people recommend Xournal, but i found it to work as a version of Gimp that i can't use. 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


                        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!






                        share|improve this answer















                        A lot of people recommend Xournal, but i found it to work as a version of Gimp that i can't use. 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


                        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!







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Dec 14 '16 at 16:36

























                        answered Feb 2 '16 at 10:26









                        danzadanza

                        1711 silver badge4 bronze badges




                        1711 silver badge4 bronze badges








                        • 2





                          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








                        • 1





                          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






                        • 1





                          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














                        • 2





                          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








                        • 1





                          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






                        • 1





                          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








                        2




                        2





                        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







                        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






                        1




                        1





                        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





                        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




                        1




                        1





                        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





                        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











                        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.






                        share|improve this answer





















                        • 4





                          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 4 '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.

                          – Jonathan Neufeld
                          Jan 6 '16 at 1:33











                        • 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 6 '18 at 10:38


















                        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.






                        share|improve this answer





















                        • 4





                          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 4 '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.

                          – Jonathan Neufeld
                          Jan 6 '16 at 1:33











                        • 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 6 '18 at 10:38
















                        6












                        6








                        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.






                        share|improve this answer















                        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.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Jan 7 '15 at 23:39









                        Forrest Voight

                        1032 bronze badges




                        1032 bronze badges










                        answered Oct 31 '13 at 0:22









                        kynankynan

                        1731 silver badge4 bronze badges




                        1731 silver badge4 bronze badges








                        • 4





                          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 4 '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.

                          – Jonathan Neufeld
                          Jan 6 '16 at 1:33











                        • 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 6 '18 at 10:38
















                        • 4





                          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 4 '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.

                          – Jonathan Neufeld
                          Jan 6 '16 at 1:33











                        • 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 6 '18 at 10:38










                        4




                        4





                        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 4 '14 at 11:12





                        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 4 '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





                        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





                        @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.

                        – Jonathan Neufeld
                        Jan 6 '16 at 1:33





                        Crashes after splash screen on Wily 15.10 using either Precise or Quantal distributions.

                        – Jonathan Neufeld
                        Jan 6 '16 at 1:33













                        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 6 '18 at 10:38







                        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 6 '18 at 10:38













                        4














                        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





                        share|improve this answer
























                        • This isn't working for me, imagamagick loads but only displays splash screen.

                          – Andreas
                          Jul 27 '16 at 20:41
















                        4














                        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





                        share|improve this answer
























                        • This isn't working for me, imagamagick loads but only displays splash screen.

                          – Andreas
                          Jul 27 '16 at 20:41














                        4












                        4








                        4







                        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





                        share|improve this answer













                        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






                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jul 9 '14 at 9:45









                        bodobodo

                        1289 bronze badges




                        1289 bronze badges













                        • This isn't working for me, imagamagick loads but only displays splash screen.

                          – Andreas
                          Jul 27 '16 at 20:41



















                        • This isn't working for me, imagamagick loads but only displays splash screen.

                          – Andreas
                          Jul 27 '16 at 20:41

















                        This isn't working for me, imagamagick loads but only displays splash screen.

                        – Andreas
                        Jul 27 '16 at 20:41





                        This isn't working for me, imagamagick loads but only displays splash screen.

                        – Andreas
                        Jul 27 '16 at 20:41











                        2














                        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






                        share|improve this answer
























                        • 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 9 '18 at 3:15


















                        2














                        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






                        share|improve this answer
























                        • 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 9 '18 at 3:15
















                        2












                        2








                        2







                        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






                        share|improve this answer













                        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







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jun 8 '18 at 23:39









                        Martin R.Martin R.

                        1212 bronze badges




                        1212 bronze badges













                        • 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 9 '18 at 3:15





















                        • 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 9 '18 at 3:15



















                        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 9 '18 at 3:15







                        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 9 '18 at 3:15













                        1














                        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.






                        share|improve this answer




























                          1














                          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.






                          share|improve this answer


























                            1












                            1








                            1







                            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.






                            share|improve this answer













                            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.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Oct 16 '18 at 4:19









                            ChristianChristian

                            112 bronze badges




                            112 bronze badges























                                0














                                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.






                                share|improve this answer


























                                • I had to add python-gi-cairo to the dependencies to make it work.

                                  – Joma
                                  Mar 18 '15 at 7:07











                                • Joma: thanks; I've now added python-gi-cairo to the list.

                                  – projix
                                  Jun 5 '16 at 20:01


















                                0














                                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.






                                share|improve this answer


























                                • I had to add python-gi-cairo to the dependencies to make it work.

                                  – Joma
                                  Mar 18 '15 at 7:07











                                • Joma: thanks; I've now added python-gi-cairo to the list.

                                  – projix
                                  Jun 5 '16 at 20:01
















                                0












                                0








                                0







                                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.






                                share|improve this answer















                                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.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Jun 26 at 14:57









                                Kusalananda

                                156k18 gold badges311 silver badges495 bronze badges




                                156k18 gold badges311 silver badges495 bronze badges










                                answered Mar 12 '15 at 8:46









                                projixprojix

                                1315 bronze badges




                                1315 bronze badges













                                • I had to add python-gi-cairo to the dependencies to make it work.

                                  – Joma
                                  Mar 18 '15 at 7:07











                                • Joma: thanks; I've now added python-gi-cairo to the list.

                                  – projix
                                  Jun 5 '16 at 20:01





















                                • I had to add python-gi-cairo to the dependencies to make it work.

                                  – Joma
                                  Mar 18 '15 at 7:07











                                • Joma: thanks; I've now added python-gi-cairo to the list.

                                  – projix
                                  Jun 5 '16 at 20:01



















                                I had to add python-gi-cairo to the dependencies to make it work.

                                – Joma
                                Mar 18 '15 at 7:07





                                I had to add python-gi-cairo to the dependencies to make it work.

                                – Joma
                                Mar 18 '15 at 7:07













                                Joma: thanks; I've now added python-gi-cairo to the list.

                                – projix
                                Jun 5 '16 at 20:01







                                Joma: thanks; I've now added python-gi-cairo to the list.

                                – projix
                                Jun 5 '16 at 20:01













                                0














                                I had trouble with LibreOffice Draw (the PDF itself got corrupted, due to the original not being perfect) and GIMP (it seemed to hang), but FoxitReader worked well. After opening the PDF, I could type in the date and name, and then use "PDF sign" to add an image.






                                share|improve this answer








                                New contributor



                                Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                Check out our Code of Conduct.
























                                  0














                                  I had trouble with LibreOffice Draw (the PDF itself got corrupted, due to the original not being perfect) and GIMP (it seemed to hang), but FoxitReader worked well. After opening the PDF, I could type in the date and name, and then use "PDF sign" to add an image.






                                  share|improve this answer








                                  New contributor



                                  Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                  Check out our Code of Conduct.






















                                    0












                                    0








                                    0







                                    I had trouble with LibreOffice Draw (the PDF itself got corrupted, due to the original not being perfect) and GIMP (it seemed to hang), but FoxitReader worked well. After opening the PDF, I could type in the date and name, and then use "PDF sign" to add an image.






                                    share|improve this answer








                                    New contributor



                                    Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.









                                    I had trouble with LibreOffice Draw (the PDF itself got corrupted, due to the original not being perfect) and GIMP (it seemed to hang), but FoxitReader worked well. After opening the PDF, I could type in the date and name, and then use "PDF sign" to add an image.







                                    share|improve this answer








                                    New contributor



                                    Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.








                                    share|improve this answer



                                    share|improve this answer






                                    New contributor



                                    Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.








                                    answered 21 mins ago









                                    Russ LyonsRuss Lyons

                                    1012 bronze badges




                                    1012 bronze badges




                                    New contributor



                                    Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.




                                    New contributor




                                    Russ Lyons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.
































                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f85873%2fhow-can-i-add-a-signature-png-to-a-pdf-in-linux%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                                        Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                                        Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...