Bug 317346 - Okular overwrites PDF form data without asking
Summary: Okular overwrites PDF form data without asking
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.19.60
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-25 19:20 UTC by Michael Witten
Modified: 2017-11-16 14:08 UTC (History)
6 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 Michael Witten 2013-03-25 19:20:50 UTC
From what I recall, Okular seems to handle a PDF's form data implicitly, transparently saving the data somewhere upon closing the PDF. When 2 instances of Okular are viewing the same PDF, the form data from the last instance to be closed is the data the gets saved, without warning.

I needed to fill out a long form while referencing instructions placed in the same PDF after the form; rather than scroll between the instructions and the form (or figure out the 'correct' way to view both at the same time), I simply opened the whole PDF again (`okular path/to/the.pdf' &), so that I could flip between the instructions and the form using my window manager. When I was finished, I closed the form and then closed the instructions, and then realized that all of my work must have been destroyed, which  it was indeed.

I find it odd that Okular doesn't treat such form data more traditionally, asking the user if data should be saved, and checking whether the file to which it would save has changed already, etc; perhaps Okular should allow the user to specify an explicit form data file, too. As it is now, It feels like handling form data was kind of tacked on using some hack within an existing feature (such as the implicit saving of which page the user was last reading).

Reproducible: Always

Steps to Reproduce:
1. okular path/to/the.pdf &
2. okular path/to/the.pdf &
3. Edit a form in one instance, close that instance, then close the other instance.
Actual Results:  
Form data is that of the instance which was closed last.

Expected Results:  
Form data is not necessarily that of the instance which was closed last.

Okular should check to see whether data should be saved, and indeed whether data has already been saved by something else.
Comment 1 Luigi Toscano 2014-05-08 13:53:44 UTC
Bug confirmed (Okular 0.19.60). Most probably the program should check for existing modification (as kwrite/kate do) and ask for.
Comment 2 Chris 2016-06-08 07:42:42 UTC
Even worse, if you have two copies of the same PDF file, the edits you make to fields in one file will overwrite the other one. This happens if the copies are created by copying the file in the file manager or when using 'save copy as', but not if 'save as' has been used.
Comment 3 Uwe Stöhr 2017-07-28 14:41:49 UTC
Still in Okular 1.1.3 and it is in my opinion a dataloss issue (from the user's perspective).
Comment 4 Andrew Chen 2017-09-10 00:42:24 UTC
Related bugs:
https://bugs.kde.org/show_bug.cgi?id=362996
https://bugs.kde.org/show_bug.cgi?id=267350

In my opinion okular should save form data out of band only for recovery purposes, and when exiting prompt the user to either save the in the pdf itself or discard the data.

I'm happy to work on this if no one else is.
Comment 5 Albert Astals Cid 2017-09-11 09:57:29 UTC
(In reply to Andrew Chen from comment #4)
> Related bugs:
> https://bugs.kde.org/show_bug.cgi?id=362996
> https://bugs.kde.org/show_bug.cgi?id=267350
> 
> In my opinion okular should save form data out of band only for recovery
> purposes, and when exiting prompt the user to either save the in the pdf
> itself or discard the data.
> 
> I'm happy to work on this if no one else is.

https://phabricator.kde.org/T4151
Comment 6 Albert Astals Cid 2017-11-03 16:09:55 UTC
For people that have an idea how to compile and test stuff, please test https://phabricator.kde.org/D8642
Comment 7 Albert Astals Cid 2017-11-16 14:08:42 UTC
This won't be anymore the case starting with the Okular that will be part of KDE Applications 17.12 (aka okular 1.3.0)