I am trying to figure out where okular
is saving annotations for pdf files. According to this answer they should be in ~/.kde/share/apps/okular/docdata
but there is no files in that folder. But still when I open the pdf file, the annotations are there. If I copy the pdf file to another file and open the other file, the annotations are gone, so they cannot be saved in the file itself either. Any suggestions?
I'm on 18.04, and using okular 1.3.3, I have just annotated several dozen comments into a 500+ page pdf. I note that in
~/.local/share/okular/docdata
, there are several .xml files named filesizeinbytes.pdftitle.pdf.xmlI don't see any of those annotations. Also, I did do a 'Save' 4 times, in an effort to make sure my annotations didn't disappear, and as a result, I have 4 different .xml files, each about 1000 bytes (by the numbers at the beginning of the .xml file's name) bigger than the last.
So, I checked the contents of the PDF file and there they are!
The contents of the text associated with the annotations are encoded in what looks like UTF-16, with a null between each character, so it's useless looking for the text inside the pdf. But using grep -a 'Annot ' I can see each of the annotations in coded format. This storage method makes automated annotation pretty difficult, but, oh well!
And, on the bright side, since the annotations are now natively included in the pdf, ANY pdf viewer (besides okular) can be used, and will see the annotations.
Previously, all okular data was stored in ~/.kde/share/apps/okular. It appears that it has finally been moved to ~/.local/share/okular where it belongs. Try looking there. You may also have to copy your bookmarks into that directory from the old one so that they work.