You are not logged in.

#1 2018-01-25 13:00:22

catnap
Member
Registered: 2016-10-03
Posts: 78

Custom annotation file for Okular or Evince

After an upgrade on Okular, the reader displayed a message saying that the old annotations will be saved in a file and that the document file will be reloaded from memory. However, my old annotations were not visible after the operation and making them so does not seem intuitive. I found out that Okular stores the relevant annotations in a special file /home/name/.local/share/okular/docdata/40006683.Landau.pdf.xml. It could be that the new version of Okular could learn to see this file as well. It would be nicer still to have manual control on where the program looks for the annotations because I would like to have these annotation files in a versioned file system, with the documents themselves. I work on copies of the same documents from multiple different workstations and keeping the annotations synchronized is paramount. Is there a way to accomplish this?

Evince also seems to read the same annotation files and to understand annotations made with Okular. A plausible next step would therefore be to configure Evince similarly.

Versions:
Okular 17.12.1-1
Evince 3.26.0+14+g2a499547-1

Offline

#2 2018-01-25 13:20:19

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 4,676

Re: Custom annotation file for Okular or Evince

The old way of saving annotations in a seperate file is deprecated, they will be directly saved into the PDF now, and should be visible (not necessarily editable) on other annotation-supporting PDF viewers. i.e. the file you are pointing out is such an old annotation file, the warning in okular tells you that these are deprecated.

Evince isn't reading that file, it simply shows the annotations as they are saved into the PDF by okular now.

Edit: Clarification

Last edited by V1del (2018-01-25 13:29:59)

Offline

#3 2018-01-25 13:25:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 19,320
Website

Re: Custom annotation file for Okular or Evince

Aggreed, annotations should be in the pdf itself.  However, I'd beg to differ on this point:

V1del wrote:

... and be visible (not necessarily editable) on any other PDF viewer.

Several pdf viewers ignore annotations entirely (I don't think mupdf even notices if they are there).  For full featured viewers (okular and the like) will show text and highlight annotations, but will miss/ignore most other annotation types.

I don't think there is currently a linux pdf viewer that can even view all annotation types.

But if one sticks to text and highlight annotations, then there are several options.

Last edited by Trilby (2018-01-25 13:26:02)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2018-01-25 13:33:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 4,676

Re: Custom annotation file for Okular or Evince

You are of course correct, appended a few things to not be as "perfect worldy" sounding tongue

Offline

#5 2018-01-25 13:39:17

catnap
Member
Registered: 2016-10-03
Posts: 78

Re: Custom annotation file for Okular or Evince

It is great that the annotations are in the actual file now. It makes things much simpler. However, there remains the problem of reutilizing the old deprecated annotations. If there is a way, I would love to know.

Last edited by catnap (2018-01-25 13:39:36)

Offline

#6 2018-01-25 13:45:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 19,320
Website

Re: Custom annotation file for Okular or Evince

There are linux libraries for adding xml annotations into a pdf file.  Poppler has reasonably good coverage of annotation types, and likely has a cli command bundled with it to do just what you want. (edit: not, just for extracting not inserting.)

If not - if you know a little C - it would be strait forward to write a tool that does this via poppler's libaries.  I had a project a while back to do this sort of thing.  I don't recall whether adding annotations was complete as that was never of much interest to me.

I don't know whether any of the gui readers have this capability - but I'd not be surprised.  Check their menus and documentation for adding annotations.

Last edited by Trilby (2018-01-25 13:47:04)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2018-01-25 14:11:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 4,676

Re: Custom annotation file for Okular or Evince

It should utilize them, if it doesn't do that and incorrectly loads the file empty that is indeed worrying. I'm not on my system right now, so I can't double check my config but I'm certain that it told me for every file that it has loaded my annotations but would save them directly into the PDF for any new/additional work.

Offline

#8 2018-01-28 23:28:02

catnap
Member
Registered: 2016-10-03
Posts: 78

Re: Custom annotation file for Okular or Evince

I encountered the problem again with a different file and paid more attention to the displayed message this time. The message first reads "Do you want to save your changes to <file name> or discard them?". After that, there is a warning box stating "You are about to save changes, but the current file format does not support saving the following elements (i.e. User annotations). Please use Okular document archive to preserve them. In case of this particular file the format was DJVU. It seems that with this DJVU file the problem reduces into making use of the newly created document archive file. Perhaps it is trivial. I will check later.

Offline

Board footer

Powered by FluxBB