Annotate PDFs On Linux With PDFrankenstein

On Windows and Mac machines, it’s not too troublesome to add text or drawings (such as signatures) to PDF files, but [Mansour Behabadi] found that on Linux machines, there didn’t seem to be a satisfying way or a simple tool. Being an enterprising hacker, [Mansour] set out to fill that gap, and the way it works under the hood is delightfully hacky, indeed.

The main thing standing in the way of creating such a tool is that the PDF format is a complex and twisty thing. Making a general-purpose PDF editing tool capable of inserting hyperlinks, notes, images, or drawings isn’t exactly a weekend project. But [Mansour] didn’t let that stop him; he leveraged the fact that tools already exist on Linux that can read and create PDF files, and tied them all together into what was at one point “a horrific patchwork of tools” which inspired the name pdfrankenstein.

The tool is a GUI that uses Inkscape and qpdf to convert a PDF page to an SVG file, set it as a locked background, then let the user add any annotations they desire, using Inkscape as the editor. After changes are made, the program removes the background, overlays the annotations back onto the originals, and exports a final file. Annotations can therefore be anything that can be done in Inkscape.

Curious about these and other tools for handling PDFs? We’ve shared some programs and tricks when we previously covered dealing with the PDF format in Linux.

20 thoughts on “Annotate PDFs On Linux With PDFrankenstein

        1. > Pasting a written and scanned signature is a security hazard, so no loss here.

          Then I assume the only way to get your signature “securely” on a form is to write it by hand and send it in snail mail. The rest of us need to email stuff so signatures eventually end up scanned, whether they were scanned separately and pasted or scanned on a completed form.

          1. Many countries have laws that make acceptance of qualified electronic signatures mandatory and provide the infrastructure for it, usually free for individuals. Nowadays a written, scanned, mailed signature is of not much legal value, everyone knows how easy it is to fake it.

    1. Oh there are many, Xournal being another one that’s been around for a long time. None of them however work to my satisfaction and are fiddly as heck or have weird UI behavior which does nothing but frustrate me. I tried half a dozen before giving up and rolling this up.

  1. I absolutely can see the need for a tool like this in this space, thanks a lot for recognizing the need and stepping up to fill it. As a 20+ year staunch Linux user on the desktop that depends on PDF files day in and day out, I honestly think that PDF readers are the most seriously deficient category and I wish they had more development focus. And no, the typical open source PDF *viewers* that many would mention are not sufficient for anything more than *viewing* PDFs.

    The bog-standard open source titles work well enough for extremely basic PDF viewing, although I have run across professionally produced PDFs that are many orders of magnitude slower to render with the Poppler backend compared to anything on Windows. But by far the biggest roadblocks are PDF forms, annotations, and printing. I have run across many PDFs produced by large organizations with forms that are simply unusable with all the standard Linux options. As for annotations, even the best open source option (Okular) is extremely clunky and limited in its annotation features compared to the Windows options. And all of the standard Linux PDF readers still lack basic printing features that Adobe Reader for Windows has offered for decades, such as a miniature preview in the print dialog and double-sided booklet printing. And PDF annotations are indeed pathetically limited compared to what is available in multiple free-as-in-beer Windows PDF viewers. For my needs thus far I’ve been using one of those under Wine. Frankly without that I wouldn’t be able to use Linux on my workstation.

    1. I do something similar, Rahim. Okular’s great most of the time, but sometimes I have to fire up a VM with Windows and Adobe. Maybe I’ll follow your suggestion amd see if I can make something work under Wine.

  2. The main problem is the PDF format itself.
    It is just a plain horrible format that should have been abolished 20 years ago.

    The only intention for .pdf was to have a format that could be sent do be printed. The focus is to have a fixed layout by design, so the printed form has the same layout as the input. (It’s also quite similar to postscript (at least some of the formats of .pdf are)

    Even something simple as a “sentence” does not exist in .pdf file. This is made abundantly clear if you try to modify a .pdf file that is formatted over multiple columns. Trying to re-flow a .pdf that was designed for A4 and then try to read it on an e-reader with a 15cm diagonal screen has so many piftalls that I stopped trying to do so.

    The lack of sentences in .pdf files is also extremely annoying if you for example try to translate a .pdf file. There are some fuzzy algorithms that try to reconstruct sentences before they get translated, but the big thing is that such guesswork should not be needed in the first place.

    I have quite a lot of .pdf files. Mostly datasheets for IC’s and I have a strong dislike for this format. Why are those things formatted in “pages”. How many people smirk when they see “this document is printed on recycled paper” in a pdf, or “this page is left blank by design”.

    PDF format is from before the internet and html existed and the file format should have died at the end of the previous century. Some zipped html format, maybe like .epub, but possibly a bit “ritcher” in features would be nice, but I’m afraid well be stuck with that horrible pdf format for years to come.

    1. What should ‘have’ and what ‘is’ are two different things. PDF is and will be a ‘standard’ means off distributing documents for a long time to come. Can say the same thing about a lot of formats out there :) .

  3. The Free Open-Source Libre-Office suite can edit .pdf files easily. Try opening the .pdf in Libre-Office Draw instead of the Write application. In many cases Draw gives me more control over the .pdf. Libre-Office is cross platform. You can install it stand-alone

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.