Tips & tricks: handwritten signatures in Okular

Today I’d like to share a tip about Okular, KDE’s flagship document reader app that’s eco-certified in Germany and used professionally around the world to secure documents.

Okular has robust support for digitally signing documents using a cryptographic signature, and it’s going to become even better soon. But what about signing documents using handwritten signatures, for those who live in places where digital signing hasn’t caught on yet?

Now, this is typically the point at which everyone who lives in a place where cryptographic signatures are common will chime in about how handwritten signatures are pointless and insecure. And they may be right, but it doesn’t matter because handwritten signatures are still used and considered valid in most of the world. And thankfully for people who live in any such part of the world, Okular turns out to support them pretty well.

The process involves some setup that you do once, and then after that’s done, the process of signing documents is suuuuuuuper simple. The time invested is worth it, trust me! So here’s how:

One-time setup process

First, you’ll need a piece of paper. Write your handwritten signature on it:

But, you know, for real

Next, scan it with SkanPage or take a picture of it with your phone and then transfer it to your computer using KDE Connect. You’ll end up with an image on your computer like this:

Open it up in Gwenview. Click the “Show Editing Tools” button in the toolbar to show the “Image Operations” sidebar. On this sidebar, click the “Crop” button and crop the image so that only the signature part is visible.

Then Click the “Adjust Colors” button:

Boost the contrast and brightness and reduce the gamma to make the background become completely white, and make the text look darker. But don’t make the text look completely 100% black; you want to preserve the appearance of real pen-strokes. It may take a bit of tweaking but keep at it! The end result will be something like this:

Now save this image somewhere on your computer using the PNG format–maybe in your Pictures or Documents folder. Don’t delete or move this image in the future!

Time to open up Okular. Go to the “Settings” menu and click “Configure Okular”. Then go to the “Annotations” page and click on the “Add” button:

A dialog window will appear. In this dialog window, give it the name “Insert Signature”, change the type to “Stamp”. Click on the little folder button next to the “Stamp Symbol” text field and navigate to the signature image file you just created:

If your file doesn’t appear in the “Open” dialog, that’s because you didn’t save it as a PNG. Re-save it as a PNG in Gwenview.

Click OK and you’re done!

Use it to sign a document

Now, the next time you have a document that needs signing, Open the annotations menu by clicking on the downward-pointing arrow next to the “Yellow Highlighter” toolbar button. Don’t click on the “Yellow Highlighter” text itself; click on the arrow next to it:

Now draw a box where you want the signature to be! There’s usually a “Date” field, so you can use the “Insert Text” annotation accessed from the same menu, and draw a similar box where you want the date to be. Enter the date when prompted.

Voila:

Easy as pie! Now you can do this almost instantly every time you have to sign a document.

20 thoughts on “Tips & tricks: handwritten signatures in Okular

  1. Cool. Love it. Is it somehow possible to fill out pdfs which do not have digital forms, but in fact are are a form? That would be helpful quite often.

    Like

    1. Yes, you can use the “Insert Text” annotation do to that as well. Just put the text you want in the places you want.

      Like

  2. Generally, you’d want your hand written signature to have a transparent background – so you can stamp it on top of other graphical elements (such as the line with the text “sign here” underneath) without blotting them out.

    I don’t know how to do that with KDE tools (Krita can probably do it, but I’ve never used it) but in Gimp it is simple: colors -> color to alpha.

    Liked by 1 person

    1. That’s a good point! For better compatibility with documents or areas that have a non-white background, removing the background and producing a PNG with an alpha channel would make a lot of sense.

      Like

    2. I’ve been doing that with a stamp that has transparent background for a few years. Works like a charm.
      I think I edited the png with gimp to get the transparency and rework a bit the line edges of the signature. But plenty of tools can help with that
      You want it to feel natural after all.

      Liked by 1 person

  3. Nice, we need more of these content – ideally people can make written/video guides for frequently asked questions, and this blog and Niccolo’s channel can publish them for visibility as both of you are, as far as I’m aware, the most visible KDE information sources.

    As for making the stamp transparent, I know you can do it with GIMP, but I often just use an online tool to do so. PDF suites like Foxit usually have a toggle to automatically do a conversion to transparent sign stamp though, so maybe a t0-do in the future?

    Liked by 1 person

    1. Yes, I’d like to improve Okular to make this process easier. Basically roll it up into the “Sign document” action, and when you use it, it will ask you whether you want to use a digital signature or a handwritten signature, and walk you through the process of setting up whichever option you choose, should it not already be set up.

      Like

  4. >> Okular has robust support for digitally signing documents using a cryptographic signature

    Sure ? I would say “buggy”, for several years. You can’t sign using a cryptographic signature. Why ? Because Okular search signature in a folder and with a format which is not the KDE default folder and the KDE default format. Read the bug report https://bugs.kde.org/show_bug.cgi?id=469705

    Like

  5. Thanks for the tutorial! However, there is one weak point and this is that the signature can be identified as stamp if you send the pdf – therefore it is NOT a handwritten signature and often companies etc do not accept this. In my experience it is required to convert the pdf, I typically convert the pdf to a raster graphic so it cannot be distinguished from a document that is scanned.

    Liked by 1 person

  6. Thanks, that eliminates a major reason for opening a windows VM.

    I’ve been searching for that feature for years and I really wish I would have known that years ago 😀

    Liked by 1 person

  7. “Easy as pie!” – “Fill and Sign” of Adobe Reader is much more “visible” though not without its share of quirks.

    Like

  8. There are a couple issues with this approach, though. I used it recently to apply my “signature” to a PDF document.

    * I had to apply my signature in multiple places. I think each signature grew the PDF size, instead of being referenced multiple times
    * The signature’s resolution was dependent on the zoom level when applying the stamp, instead of being, say, 300dpi.
    * this made the document grow from 200Kib to 1.4Mib. I think a colleague’s signature only increased the original document size with a few dozen KiB.
    * box-drawing to stamp didn’t preserve the aspect ratio of the signature, leading to trial-and-error. It would be nice to have this as a property of the stamp.
    * (optional) I am uncomfortable doing this without watermarking my signature for the specific document, I wish this was done automatically.

    Liked by 1 person

  9. This is quite handy. I was using a transparent signature png for my latex files and it worked great.

    But using the stamp feature in Okular my file size increased from 410kb to 1.1Mb with a signature png of 230kb. This is terrible, what happens there?

    Like

    1. As a perfect workaround I used QPDF:

      > qpdf File_with_Okular_Stamp.pdf –recompress-flate File_Small_Again.pdf

      This reduced the file size to 430kb! again (compared to 1,1MB with Okular stamp und 410kb of original pdf).

      Like

  10. It’s a pity that it’s so unobvious. First, I see that the names of Signatures is incorrectly translated, so it sounds to me like “Descriptions” which is misleading. Anyway, then I wanted to choose “Stamp” and… there was not such option. Again, translation issue, because none of the options means “Stamp”… I belive the corresponding option is named in my language “a little sign”. Almost funny… It looks like the translation was automatic and didn’t take context (the app, the function) into the account :(.

    In the past I wanted to help with translations, but it was so hard to get into it (no one could explain to me clearly how it works and the person who were doing the translations, were like typical geeks, who can’t speak in a human language and behave as if they had the only right, so any issues were not acknowledged…), so eventually I gave up. I also have no idea how to submit localization bugs, but given the people who are doing localization, I doubt they would even care.

    So not only the option is buried and not discoverable, the bad localization makes it even harder to find.

    Still, it’s awesome that the option exists. This was in the past the biggest issue for me. I had to install Windows apps just to have this option. Now I don’t have to.

    Like

Leave a comment