Bug 301774 - Wish: New option to save embedded annotation upon change/document close
Summary: Wish: New option to save embedded annotation upon change/document close
Status: RESOLVED DUPLICATE of bug 315552
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 19:49 UTC by Philipp A.
Modified: 2017-10-19 14:59 UTC (History)
21 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp A. 2012-06-12 19:49:34 UTC
While being happy that bug 151614 is fixed (thanks again), i asked about some specifics of the implementation. The following wish arose:

If someone wants to have their annotations saved as automatically and unintrusively as possible inside the document, they should be able to make okular do so.

My idea was that there is a checkbox in the options which replaces the current behavior of asking to save modifications on document close with automatic saving in the original location; either on document close or  – even better imho – after each modification. (it’s better because if saving happens implicitly and without notice, it should be as soon as possible to reduce data loss in case of crashes)

tl;dr: add checkbox to enable implicit saving of annotations into the original document after each modification.

PS: i can’t overstate how glad i am that you implemented internal annotations!

Reproducible: Always
Comment 1 Dotan Cohen 2012-06-12 20:42:35 UTC
I should stress that keeping the annotations together is a very important workflow. I have been in collaborative projects where we would receive documents to annotate and send on the the next person. If that person will not get my annotations because I forgot to set some setting then that could be troublesome. This needs to be a set-and-forget operation.

Thank you!
Comment 2 Till Schäfer 2012-08-03 11:16:59 UTC
i write the same down here what i wrote in the implemtation bug of the annotation storing feature # 151614 . 


It is very unintuitive that you have to do "save as" for storing annotations. i could understand that the file should not be modified without an extra save action, but why isnt there a simple save option? An example: when i like to add a comment to a new pdf i have to click "save as", than "save" (in the file selction dialog) and confirm the override waning. some time later i try to modify something. That leads to the question if i like to store the annotations. Again there is no "save", but only "save as". At this point it is getting totally unintuitive. I have never seen such a dialog before whith only save as and no simple save as confirmation. So it aks me if i like to save the annotations, i select "save as", than "save" in the file selection dialog, again confirm the overwriting of the file. This is unnescesary confusing. simply introduce save and everything will be much more consistent. This makes me feel like always working with write protected files. The many hints in the form of dialogs that appear to explain the behaviour to the user, are a symptom of not consistent workflow. would be nice to see this corrected. Then this feature is awsome and very usable.
Comment 3 Albert Astals Cid 2012-08-03 11:19:58 UTC
Saving might destroy your file since poppler saving is not really 100% working yet, that is why you should save as and not save+overwrite, because you'll loose your file and then you will come to us and shout to us and make our life miserable.
Comment 4 Mathias Dietrich 2012-08-03 11:30:36 UTC
So why not using a checkbox, as the bug-opener proposed ? 
Keep the save as dialog as default setting, it's also the same under Evince.
But add a simple checkbox to the general options. If selected and the user adds annotations, the annotations are automatically written to the pdf file, either when the file is closed or when the annotation is added. It depends on the actual implementation.
With this solution you can make both sides happy.
Comment 5 Dotan Cohen 2012-08-03 11:31:49 UTC
> Saving might destroy your file since poppler saving is not really 100% working yet
>

Where is the poppler bug on this?

Also, this dataloss bug should be stated right in the UI. I cannot believe that this is the first that I hear of this. I am already slated to deploy to a university lab with about a dozen users, and the PDFs are to be distributed to hundreds of students. Users should be made aware that this is an experimental feature.
Comment 6 Albert Astals Cid 2012-08-03 11:42:46 UTC
It is waiting for you to report it.

It is not an experimental feature.

If is just a feature that can have bugs, it just turns out that if it has a bug it will destroy your document.

So just do as the program suggests and "Save as..." not "Save as..."+overwrite.
Comment 7 Dotan Cohen 2012-08-03 15:04:29 UTC
> It is waiting for you to report it.
>

How can I reproduce the bug? And if you have reproduced it, why haven't you reported it?

Seriously, I just lost a lot of respect for Okular and KDE in general if a key dev knows about a dataloss bug on file save, and instead of fixing or even reporting it he decides to work around it by encouraging the user to save as a new file instead, with no explanation or warning.

Please tell me that I misunderstood you. I'll really want to see that I simply misunderstood and that the reality is _not_ as described in the previous paragraph. If I did misunderstand, you can freely curse me for construing the above paragraph!
Comment 8 Albert Astals Cid 2012-08-03 15:17:11 UTC
You have several misunderstandings here:
 a) Okular != KDE, you need to understand that KDE is composed by hundreds of people and that what one developer does or does not has nothing to do with the rest of hundreds of developers
 b) Did you ever respect me? Doesn't really seem so reading bugs for the past years, maybe it's because english is not my native language
 c) Where did i say i know there are dataloss bug? I just said that given poppler code for writing files is new and not well tested it may have bugs that destroy your files and you would hate me, but wait, you started hating me already! I should really hide in my cave and not interact with users because all i get is grief, and you know what, it's not even me that developed this feature!

And finally please stop acting with bad attitude and be constructive, me and all the people here are doing this in our spare time, and sincerely, noone likes being hated for the work they do in their hobby time.
Comment 9 Till Schäfer 2012-08-03 15:29:44 UTC
OK we might all come down a bit and stay on technical discussion. The goal should be to get the best software...

@Albert Astals Cid: 
well every feature can have bugs. so if this is not experimental or in development, what does it make different from saving a file in kate, libreoffice or any other tool that is out there? I think this was a little bit confusing. 

At least you may acknowledge that if you save your file very often the save as gets realy anoing, since once you have saved one annotation internaly you have to save every change also internaly. So you will end up with 50 different file versions.. always check if it correctly saves everything and than delete them. This does not seem to be a propper, matured and productive workflow.  The question is how we can get safety and a good workflow together. 

if hte poppler backend is not reliable, "save as" does not prevent me from overwriting files. I used it this way and where not warned that this may cause data loss in any way by okular. So maybe it is better to introduce a "save" function but inform the user in a dialog that this is still some kind of experimental and he should keep backups. If there is an option to disable the disalog, this solution would not stay in the way, but still gives the user all information he/she needs. if the poppler feature is matured you can remove that dialog at all.
Comment 10 Dotan Cohen 2012-08-03 16:08:12 UTC
Albert, you know that I respect you. My bug reports are quite the way that I show that I appreciate your contributions. I need to run, but I will contact you in private mail soon. And don't worry, I charge that your English is better than mine!
Comment 11 Philipp A. 2012-08-03 17:32:05 UTC
(In reply to comment #8)
>  Did you ever respect me?
> […]
> And finally please stop acting with bad attitude and be constructive, me and
> all the people here are doing this in our spare time, and sincerely, noone
> likes being hated for the work they do in their hobby time.

i’m sure nobody here disrespects you. keep reading:

the only misunderstanding that happened is that you just said something like that:

> the pdf format is really difficult, and write support for such a format is error-prone, so while there are no known issues, there might as well be some that eluded us and will bite users in the ass, which will proceed to hate us.

with th attitude “users will hate me anyway :(((” you read dotan’s comment, which should have read like this:

> what? you know of a specific bug in poppler’s pdf writing part and didn’t report it? i’m not sure if i understood that right [note: he didn’t], but if that is the case, i’d say that was a bad decision under all imaginable circumstances.

…but both comments weren’t as clear, so you interpretted *his* misunderstanding of *your* previous comment as personal attack.

now i hope we can return to this:

—————————————————

imho, i also think a pure save-as feature doesn’t make sense, even if the underlying function isn’t 100% tested (because that’s not really possible)

since you decided to ship the feature anyway with crippled usability to prevent users from shooting theirselves in the foot without knowing, i’d propose to give those masochists of us who like to shoot themselves in the foot the ability to do so without hassle.

TL;DR: since you added the feature, please also add the checkbox to enable one-click-save+overwrite, and add abig warning next to it explaining why it is there.
Comment 12 Alberto 2012-09-07 16:41:45 UTC
Would like to see this feature. I've upgraded poppler to version 0.20, and now it's capable of saving PDF annotations in the file itself. Problem is, I have to "Save As..." everytime I make some changes to the PDF.

It would be really nice to let Okular save the document automatically upon close or even when editing something in it. Combining this with a cloud-synchronized folder make it a killer researcher tool.

Thanks in advance.
Comment 13 nizamov.shawkat 2012-09-21 13:28:17 UTC
Thank all developers for the annotations feature working "right" - embedding them into the file (how it is generally assumed). But it does not save them in the same file, which was opened (no "save" option) - this is what this bug is about. This really limuts the usefullness of the annotations feature. 

However, reading the response of Albert, I realize that there might be a good reason - if overwriting the existing file actually corrupts its content, then the file is lost. 

In this case the following two features would be really helpful:

1) pressing "Save as" or "Export as" should point exactly to the folder, where the opened file is. Now (at least on my pc) it points to the last saved folder and I have to find folder with the original file. Sometimes it is not easy - e.g., I open pdf attachements from zotero/firefox and it stores pdf's in its own file hierarchy with randomized folder names. 

2) there may be an option of automatically saving the file with slightly modified filename (***-annotated.pdf). This way the original file remains intact, and all annotations go to the annotated file. Later if we open the file, and its filename conatins already "annotated" mark and there also exists a file with filename without this mark in the same folder (it means that we opened already annotated file and we have also an original file nearby), than the annotated file will be overwritten. What will you loose in the worst case is your annotations. This is how it works in Goodreader - very popular pdf annotation software which I use on ipad.

Preferably, both features should be combined - so that pressing "Save" will point to the folder with original file and suggest a filename with defined annotation mark. If it was detected that the file is already an annotated version of original, then annotated file will be overwritten without asking anything. 

As an additional feature, one might think about always opening the annotated version instead of original. On one hand it might be misleading - you clicked on original in file browser but got an annotated version of it opened, on the other hand you will not accidentally overwrite annotation made previously, if you opened the original, made something to it and saved.  

The advantage of such workflow is that original file is always retained - so this is safe. And you can always give someone the original file without annotations if required. 

Sorry, if i am asking too much, and best wishes
Comment 14 luckyrand 2012-10-26 20:14:07 UTC
I'm so happy that internal annotation works. Thanks a lot!

I also believe saving annotation with documents easily is an important feature. Util read the tread, I didn't realize overwrite pdf files might be risky, and just save as and overwrite the original file. If overwriting is too risky and should be avoid, a menu and hotkey to save to a renamed version would be useful, because that is how the user use it. I'm not quite sure, but maybe a menu can be added
 > save annotated version as(Ctrl+S)
which works the same way as the menu "Save As", but with the default directory as the same directory as the current file, and default file name as filename(Okular Copy).pdf. We can use the menu "Save as" to do it, but it require too many steps.

Furthermore, Okular can mark this file as a copy, and assume the user backup the file somewhere, so auto save the the annotation to the pdf file.
Comment 15 Sudhir Khanger 2013-02-24 08:11:09 UTC
Saving multiple copies for number of annotations of the same document is hardly a solution.  I am glad this is worked on thanks.
Comment 16 Fabio D'Urso 2013-03-30 13:33:27 UTC
(In reply to comment #6)
> > > Saving might destroy your file since poppler saving is not really 100% working yet
> > Where is the poppler bug on this?
> It is waiting for you to report it.
Albert, apart from my save-twice mistake, I don't remember reading complaints about Poppler's save features. Are we more confident now about this?
In other words, do you think time for this feature has arrived? Of course, we can still save backups before writing a'la mydocument.pdf~
Comment 17 Albert Astals Cid 2013-04-01 22:48:39 UTC
Well, to be honest i'm not sure people will be happy with their files doubling size at each save :D

Maybe you can have a go at an implementation that depends on the poppler with that bug fixed? + backups
Comment 18 wangliangxu 2014-03-10 08:59:13 UTC
I am confused by the default "save" and "save as..." function too, and personally I would prefer the "save as..." as the "save" function. 
So maybe an option (checkbox) could be added in the option dialog, let the user decide which option he would choose, and tell his the danger with save annotation internally?
Comment 19 Inigo Aldazabal Mensa 2017-08-18 08:01:54 UTC
(In reply to nizamov.shawkat from comment #13)

> 2) there may be an option of automatically saving the file with slightly
> modified filename (***-annotated.pdf). This way the original file remains
> intact, and all annotations go to the annotated file. Later if we open the
> file, and its filename conatins already "annotated" mark and there also
> exists a file with filename without this mark in the same folder (it means
> that we opened already annotated file and we have also an original file
> nearby), than the annotated file will be overwritten. What will you loose in
> the worst case is your annotations. This is how it works in Goodreader -
> very popular pdf annotation software which I use on ipad.
> 
> Preferably, both features should be combined - so that pressing "Save" will
> point to the folder with original file and suggest a filename with defined
> annotation mark. If it was detected that the file is already an annotated
> version of original, then annotated file will be overwritten without asking
> anything. 
> 
> [...]
>
> The advantage of such workflow is that original file is always retained - so
> this is safe. And you can always give someone the original file without
> annotations if required. 

I totally second this approach. In fact I was about suggesting exactly the same thing.
Comment 20 Nate Graham 2017-10-19 14:59:13 UTC
I'm going to mark this bug as a duplicate of Bug 315552 so we have everything tracked in the same place. I encourage everyone who cast votes for this to move their votes to 315552, because Bugzilla doesn't do it automatically.

Let's try to avoid extended arguments going forward. We all want this feature, but the thing that will make it happen fastest is a patch coupled with respectful dialogue.

*** This bug has been marked as a duplicate of bug 315552 ***