11

I am using Okular as my pdf reader on Linux. I want to know how I can modify the color of the highlight permanently. I know I can modify the saturation of the color used by highlight tool by right clicking on the highlight selection and making the desired modifications. However, those are applicable only to the current selection.

How can I set okular to maintain those settings for every highlight in the file(and still allow customising at specific positions) and also maintain them after the file is closed [and opened later .i.e. the settings are not lost]

0

2 Answers 2

11

I wanted to permanently set the highlighters to a few colors and do away with the green line and polygon stuff. It turns out you can modify what highlighters are available by modifying the tools.xml file. For me (Okular 0.16.3 from official repository on Ubuntu 13.04), this is located at /usr/share/kde4/apps/okular. You should be able to divine this by running kde4-config --path data and appending okular to the last path (but see update below).

In there, you'll see things like

<tool id="7" name="Stamp" pixmap="tool-stamp-okular">
    <tooltip>Put a stamp symbol</tooltip>
    <engine type="PickPoint" hoverIcon="okular" size="64" block="true">
        <annotation type="Stamp" icon="okular"/>
    </engine>
    <shortcut>7</shortcut>
</tool>

If you replace it to look like the yellow highlighter's block, you'll get a similar highlighter. In my case:

<tool id="7" name="Magenta Highlighter" pixmap="tool-color-magenta">
    <tooltip>Magenta Highlight</tooltip>
    <engine type="TextSelector" color="#FF99FF">
        <annotation type="Highlight" color="#FF99FF" />
    </engine>
    <shortcut>7</shortcut>
</tool>

The tool-color-magenta pixmap is stored in /usr/share/kde4/apps/okular/pics and you can put a png there.

So now my review toolbar looks like this:

enter image description here

I needed to sudo to modify these files.

Update: following the periodic software update window in ubuntu, I have upgraded Okular to 0.16.4, which restored the default tools.xml. It looks like if instead you copy or symlink your customized files to the kde apps okular path under your $HOME (in my case, $HOME/.kde/share/apps/okular), it should take precedence over the /usr/share/... ones and save you some trouble.

4
  • Great fix, but any way to modify the colors of annotations written to the pdf by Acrobat? This makes my own annotations more legible but doesn't help with imported documents.
    – mmdanziger
    Commented Jan 6, 2014 at 12:09
  • 1
    Short answer is no. Okular stores annotations in an xml file separately from the original pdf, whereas Acrobat stores them inside the pdf (also the case if you use the new Okular export facility). There are various tools to work wtih in-pdf annotations but if you want to convert them into or edit them in Okular you will most likely need to roll your own. Commented Nov 4, 2014 at 16:05
  • @directedlaugh do you know how to edit the default font size for inline notes? I guess it should also be possible to specify it in the tools.xml
    – cknoll
    Commented Jun 22, 2015 at 19:46
  • I think you're able to do this directly from the menu bar -- Settings > Configure Okular > Annotations > Inline Note. Never edited the xml but the settings menu will probably write it to xml Commented Jun 25, 2015 at 16:16
1

In newer versions of Okular (the mine are Okular 1.9.3, Qt: 5.13.2, KDE Frameworks: 5.70.0), it is possible:

  • to configure the tools via a UI
  • to carry a configuration from one installation to another

If you do not personalize your tools, Okular uses by default a system-wide configuration file (for instance, that is /usr/share/okular/tools.xml in my Fedora 31).

In order to configure the tools via UI, go to Settings > Configure Okular... > Annotations.

The personalized tool settings are stored as the value associated with the AnnotationTools key (see the [Reviews] section) of the $HOME/.config/okularpartrc file. These settings override the default system-wide ones.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .