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.

7 Answers 7

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
2
  • 1
    This worked for me (Ubuntu 18.04), but provided that all the full path is in lower case. The file does not need to be in .kde/.
    – magiraud
    Commented Jan 30, 2019 at 7:01
  • You also cannot use ~, i.e. you have to use /home/<user>/stamp.png instead of ~/stamp.png.
    – Nova
    Commented Jun 26, 2019 at 14:38
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)
3
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.

6
  • This is really commentary on another post rather than a solution to the question.
    – fixer1234
    Commented May 1, 2017 at 20:16
  • 2
    "You must have 50 reputation to comment"
    – cengique
    Commented May 2, 2017 at 20:52
  • 1
    Correct. Answer posts are reserved for solutions. Posting a comment as an answer tends to attract downvotes as a "non-answer", which will offset gaining the rep needed to comment.
    – fixer1234
    Commented May 2, 2017 at 21:03
  • 3
    I actually don't care about the reputation game, and wanted to simply share my solution. Since I can't comment, I was forced to create a new reply. What's your solution?
    – cengique
    Commented May 3, 2017 at 22:23
  • 1
    I went ahead and copied it to a comment for you so the information won't be lost if/when this post is deleted.
    – fixer1234
    Commented May 3, 2017 at 23:49
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)
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

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.

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!

1
  • 1
    (1) Yours is the sixth answer to this question.  If you are referring to one of the other five, please say which one.  (Ideally, identify it by author’s name and link to it.)  (2) Can you clarify exactly what you are saying? … … … … … … … … … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete. Commented Nov 20, 2019 at 1:06

You must log in to answer this question.

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