I just started using the KF5/qt5 port of Okular and noticed annotations won't save to the doing a "save as". When I try to overwrite the existing file I get the following error: "File could not be saved in '<path>'. Try to save it to another location." When I save it to another location instead of overwriting the original document, it saves, but without annotations. Okular version is reported as 0.9.80. KDE Neon, Developer Edition (git stable).
Works fine here, can you attach a file that doesn't work for you?
Created attachment 102490 [details] File for which annotation fails to save
I've tried it on various pdfs built in various ways (e.g. pdflatex) and none work. I wonder if I should wipe my okular settings. Do you know where they're kept?
No need to wipe the settings, have nothing to do with this. Can you please describe exactly what you do, i.e. which kind of annot you add, which menus you press, i.e. every single step.
Strangely enough, it's working now. I've tested a number of pdfs and everything works just fine.
I can confirm this using KDE neon Dev Stable edition package build: 4:16.08.90+p16.04+git20161123.1830-0 (so built on 23 November from Applications/16.12 branch) okular --version: 0.99.80 open a PDF in okular press F6 Click Freehand Line and add a line to the document File -> Save As -> Save (same file name -> Yes (to replace it) "File could not be saved in 'file:///root/foo.pdf'. Try to save it to another location." on closing and re-opening the file has saved correctly This does not happen with Neon Dev Unstable (master branch, okular 1.0.70) not with Neon User (kdelibs4 build) Nothing looks relevant on command line output This seems to be unrelated to the earlier issue of Neon packages where some files were in the wrong package, same issue if the okular-extra-backends package is installed or not.
master and Applications 16/12 are *veeeeeeery* similar code, i can't see how one would work and not the other. Are you really trying to save in /root/foo.pdf ? Are you running okular as root?
No further answers, reporter states it's working and I also cannot reproduce on Neon with the attached PDF. I don't think running Okular as root is supported. Closing for now, please reopen if needed.
I can also confirm on Okular 1.0.3, Backend 0.6.5, KDE 5.31.0, Qt 5.7.1, XCB, Ubuntu 17.04. Just like what happens with Michael D., saving to another location loses the annotations. Just like what happens with Jonathan Riddell, despite the warning "File could not be saved in...", the file is saved correctly. A new observation is that if I save to another filename, move this new file to another folder and then rename the new file to the original filename, the annotations are shown. It seems that the annotations are not lost, but depend on the name of the original file, not depending on its path.
For Okular 1.3 (KDE Applications 17.12), saving annotations now always saves to the PDF, using the XML file (which results in the behaviour you see regarding dependence on filename, but not path) is not supported anymore. Therefore I doubt this is still an issue. Nevertheless, please retest with the newest version and report back if it still fails. Then it would also be great if you provided exactly the steps you followed and attached the PDF.