The truth is rarely pure and never simple

Store okular annotations in PDF

In general, okular stores the annotations in a XML file somewhere in your .kde-folder. Although you may export the annotations together with the relevant file using the so called document archive, this does not help in case you want to print the decorations or in case you want to pass the file on to someone without okular.

Here is a script that stores (most of) your annotations in a new PDF: okannotate.py. Please note:

  • Call the script with python okannotate.py inputfile.pdf outputfile.pdf
  • You will need python.
  • In contrast to the way okular displays the annotations, everything is drawn on the background. Hence, you can mark text without affecting the readability of text nearby.
  • As of version 0.14.3, okular knows nine types of annotations: the supported ones are:
    1. Green Freehand Line
    2. Yellow Highlighter
    3. Straight Yellow Line
    4. Blue Polygon
    5. Black Underlining
    6. Cyan Ellipse
  • While you can edit the annotations in okular for your first document, the added decoration in the new PDF will stay permanently.

Example page displayed in okular
Example page displayed in okular

Example page with stored annotations
Example page with stored annotations

Leave a comment

Your email address will not be published.