This forum has been archived. All content is frozen. Please use KDE Discuss instead.
Please use bugs.kde.org for bug reports or feature requests. Development related questions should be directed to the okular-devel mailing list.

Does Okular auto save added annotation to the original file?

Tags: None
(comma "," separated)
timlee
Registered Member
Posts
22
Karma
0
When adding an annotation to a pdf or djvu file,

1. sometimes Okular notifies me:
Your annotations are saved internally by Okular.
You can export the annotated document using File -> Export As -> Document Archive


So if I close the file, and open it again in Okular, I can still see my annotations added last time. But if I open the file in another application (e.g. evince, or djview), I can't see the annotations I added in Okular. I wonder if the annotations are saved into the original file and only viewable in Okular without exporting?

2. Sometime Okular notfiies me
Your annotation changes will not be saved automatically. Use File -> Save As...
or your changes will be lost once the document is closed


So I have to follow File -> Save As to save it. Otherwise, all annotations will be lost after closing the file.

I wonder why sometimes Okular can save annotations automatically, and sometimes not?

Also there is a underline below "A" in "Save As...". but I can't invoke it by Ctrol+A, which instead select all the text. Is there a shortcut key to invoke it?

My OS is Ubuntu 12.04. Okular is Version 0.17.2, using KDE Development Platform 4.8.5 (4.8.5).
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
See http://docs.kde.org/stable/en/kdegraphi ... tions.html

So if I close the file, and open it again in Okular, I can still see my annotations added last time. But if I open the file in another application (e.g. evince, or djview), I can't see the annotations I added in Okular. I wonder if the annotations are saved into the original file and only viewable in Okular without exporting?


"Since KDE 4.2, Okular has the "document archiving" feature. This is an Okular-specific format for carrying the document plus various metadata related to it (currently only annotations). You can save a "document archive" from the open document by choosing File → Export As → Document Archive. To open an Okular document archive, just open it with Okular as it would be e.g. a PDF document."

Exporting won't save the annotations to the PDF file.

"Since Okular 0.15 you can also save annotations directly into PDF files. This feature is only available if Okular has been built with version 0.20 or later of Poppler rendering library. You can use File → Save As... to save the copy of PDF file with annotations. "

So I have to follow File -> Save As to save it. Otherwise, all annotations will be lost after closing the file.

I wonder why sometimes Okular can save annotations automatically, and sometimes not?


Could be due to the following:

" If you open a PDF with existing annotations, your annotation changes are not automatically saved in the internal local data folder, and you need to save the modified document (using File → Save As...) before closing it. Should you forget to do this Okular will show confirmation window that allows you to save the document. "

Also there is a underline below "A" in "Save As...". but I can't invoke it by Ctrol+A, which instead select all the text. Is there a shortcut key to invoke it?


Try Alt+A (this should be the same for all keyboard accelerators, i.e., underlined letters).


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
timlee
Registered Member
Posts
22
Karma
0
thanks.

In either case, where does Okular save my annotations to a pdf file:
inside the pdf file (or a new pdf file if I save to another file),
In a separate non-pdf file under the same directory with the pdf file, or
in some other path?

I stilll don't understand when Okular can save annotations automatically, and sometimes not?
In case 1, I don't have to do anything, all my annotations are saved automatically.
In case 2, if I forget to save my annotations, Okular doesn't say anything, and all my annotations will be lost.

I should have said that Alt+A doesn't work.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
timlee wrote:In either case, where does Okular save my annotations to a pdf file:
inside the pdf file (or a new pdf file if I save to another file),
In a separate non-pdf file under the same directory with the pdf file, or
in some other path?

I stilll don't understand when Okular can save annotations automatically, and sometimes not?
In case 1, I don't have to do anything, all my annotations are saved automatically.
In case 2, if I forget to save my annotations, Okular doesn't say anything, and all my annotations will be lost.


As far as I know:

By default all annotations are stored in a local data directory (something like ~/.kde/share/apps/okular/docdata).
However, if your PDF file already has annotations, the new annotations won't be stored in the data directory. Instead you'll be asked if you want to save the document, which will save the annotations to the PDF file.

I should have said that Alt+A doesn't work.


Ah, you mean Save as... in the menu? To access it you have to first press "File", which you can access with Alt+F. So Alt+F+S should save the file. You can also assign a custom shortcut to Save as... under Settings -> Configure Shortcuts.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
timlee
Registered Member
Posts
22
Karma
0
thanks.
If I want to save the annotation to the pdf file or a separate file under the same directory, so that when I view the file on another computer my annotations are still there, what shall I do?

Hans wrote:
timlee wrote:In either case, where does Okular save my annotations to a pdf file:
inside the pdf file (or a new pdf file if I save to another file),
In a separate non-pdf file under the same directory with the pdf file, or
in some other path?

I stilll don't understand when Okular can save annotations automatically, and sometimes not?
In case 1, I don't have to do anything, all my annotations are saved automatically.
In case 2, if I forget to save my annotations, Okular doesn't say anything, and all my annotations will be lost.


As far as I know:

By default all annotations are stored in a local data directory (something like ~/.kde/share/apps/okular/docdata).
However, if your PDF file already has annotations, the new annotations won't be stored in the data directory. Instead you'll be asked if you want to save the document, which will save the annotations to the PDF file.

I should have said that Alt+A doesn't work.


Ah, you mean Save as... in the menu? To access it you have to first press "File", which you can access with Alt+F. So Alt+F+S should save the file. You can also assign a custom shortcut to Save as... under Settings -> Configure Shortcuts.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
You should use File → Save As... to save the annotations to the PDF file, so that other programs can read them.

If you don't want to save the annotations to the PDF file, but still want to access them from Okular on another computer, you can use the File → Export As → Document Archive feature.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
robson
Registered Member
Posts
8
Karma
0
You can Remove all annotations from a PDF document:

$ pdftk original.pdf output uncompressed.pdf uncompress
$ LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
$ pdftk stripped.pdf output final.pdf compress

source: https://gist.github.com/stefanschmidt/5 ... ions-sh-L1

After clean old annotations, Okular will save new annotations automatically in the storage folder.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]