8

There's an excellent post on customising Okular to modify highlight tool properties at Customise Okular to modify highlight tool properties It's helpful but it deals with modifying an existing tool feature. I want to add my own annotation "Stamps" so that with a click or two I can place them on a PDF document. I suspect it involves modifying the tool.xml file and adding .png files of the "stamps" to a folder. More specific guidance would be appreciated.

Mick Thomason
  • 81
  • 1
  • 4

7 Answers7

5

In the Okular docs page there is explained the mothod to add a custom stamp:

  1. Create the icon you want to use for your own stamp and save it in any graphics format supported by Okular
  2. Click the Add button, select type Stamp and enter a name for your stamp.
  3. Enter the full path to your custom icon into the dropdown box in the Stamp Symbol group
dharman
  • 99
4

Since Okular 0.24 it's possible to define your own stamps.

  1. You create your own stamp and save it as png or svg. (Ex. picture.png)
  2. Copy it to ~/.kde4/share/icons/ (or .kde whichever is used)
  3. In Okular you go to Settings->Configure Okular->Annotations
  4. Click on "Add". Chose Type "Stamp"
  5. Give it a name in "Name:"
  6. In the box "Stamp Symbol" enter your own file. (Ex. picture.png)
bengan
  • 41
4

I followed up @bengan's recipe, but copying to the ~/.kde4 location didn't work. Only when I copied my file under /usr/share/okular/pics/, it did show up inside Okular, but it still won't print out.

cengique
  • 189
  • 1
  • 3
2

It took me a while to figure this out. I had to use strace and discovered ocular looks for the lower case of the filename you enter manually, rather than the actual case you enter. (my file had upper cases in it.)

So adjusting the post from @bengan for Ubuntu 16.04, Okular 0.24.2 -

  1. Create your own stamp and save it as png or svg, making sure it is all lower case. (Ex. picture.png)
  2. Copy it to ~/.kde/share/apps/okular/pics/ (or .kde4 whichever is used)
  3. In Okular you go to Settings->Configure Okular->Annotations
  4. Click on "Add". Chose Type "Stamp"
  5. Give it a name in "Name:"
  6. In the box "Stamp Symbol" enter your own file. (Ex. picture.png) The path should not be necessary and the actual picture should show up when you get it right. (it searches for it as you type)
SDsolar
  • 1,696
1

I use Kubuntu 18.04 and for me this worked:

1) Go to /home/me/.kde/share/ [use your user name instead of "me"]

2) create folder: icons if it hasn't already been created

3) create a png file using your preferred software (example: GIMP)

  • the png image must be flat, without a transparency or alpha channel (GIMP lingo)

4) copy the png into /home/me/.kde/share/my.png (avoid spaces etc in your name)

5) Within Okular, go to Settings>Configure Okular>Annotations>[ADD]

  • From the top of the Dialog, select Type:[STAMP] From the bottom of the Dialog, paste in the full path and filename/home/me/.kde/share/my.png

  • For some reason, I also had to remove the .png from the pasted in
    image name. For example, my filename was
    /home/me/.kde/share/my.png but I had to type in
    /home/me/.kde/share/my

user12711
  • 195
0

Actually, all the answers here are partially correct. Here is the rest.

  • The path for me was ~/.local/share/apps/okular/pics/
  • The file must have PNG, XPM, SVGZ or SVG extension (JPG and PDF don't work)
  • Then go in Settings > Configure > Annotation
  • Click "Add", choose "Stamp", give it a name and put the file name without extension and without path into the "Symbol" field. It should show the image at once.
  • Click OK.

Now you can use the file as a stamp. However, it will be distorted since it must be a square image and reduced in quality to fit the 128x128 (?) size required for stamps.

Jens
  • 133
  • 5
0

For Linux Mint 19.2 - Cinnamon - Okular 1.3.3 :

  • Folder : ~/.local/share/okular/ already exists
  • Create ~/.local/share/okular/pics/ and place your stamp there.

Then above mentioned procedure works!