Bug 320224 - pdf cache problem using form pdf
Summary: pdf cache problem using form pdf
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.15.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-24 15:39 UTC by batclod
Modified: 2013-05-24 17:25 UTC (History)
2 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 batclod 2013-05-24 15:39:05 UTC
okular 0.15.5 (kde 4.9.5) but this bug affects all the prevoious versions (usually i work on kubuntu, official deb package - actually on quantal, same problem on previous version)

okular cache the pdf content. 
opening (ex. pdf1) and saving it as a a modified version of the same document (ex. pdf2) both files are opened showing the last cached version (pdf2)

To solve and view the real file contents clear the file cache in .kde/share/apps/okular/docdata/

Reproducible: Always

Steps to Reproduce:
to reproduce this bug:

get a form pdf (voidform.pdf) 

open voidform.pdf 
push modify-form buttom 
compile some form fields.
push stop-modify-form buttom 

saving the compiled module from file menu (2 options)
save as
save copy

in both cases save and close.

now the directory there's two pdf
voidform.pdf 
voidform-compiled.pdf

now opening the files in both cases okular shows the filled version (the last) and never the void (original) file.
Comment 1 Albert Astals Cid 2013-05-24 15:46:54 UTC
That's how our form feature works, save the second file with a different name if you don't like the behaviour or vote in the existing bugs that ask to change the behaviour
Comment 2 batclod 2013-05-24 16:05:24 UTC
the file is saved with a different name : 

the original file is voidform.pdf 
the filled one is saved as voidform-compiled.pdf

okular opening the pdf shows both files as filled.

the real content of voidform.pdf is not what okular shows.
Comment 3 Albert Astals Cid 2013-05-24 16:17:12 UTC
It is, you filled the forms and thus we remember you did even if you didn't save the file. As said that's the default behaviour and not a bug, if you don't agree you may vote on some of the other bugs around this area.
Comment 4 Fabio D'Urso 2013-05-24 16:23:09 UTC
As Albert said, this is what's happening in detail:
 1) the original file is left untouched *but* okular saves filled data in docdata/
 2) the new file of course contains the form data you typed
There's no "bug" in this: this "feature" is what lets you to fill a form, close okular without saving, reopen the document and still see your forms filled. A possible workaround is to create a copy of the original document *before* filling forms, and then fill the copy.

A better solution would be to let the user disable automatic saving of metadata through a metadata setting panel (there are already some bugs/wishes about it), but unfortunately we have limited manpower :(
Comment 5 batclod 2013-05-24 17:25:18 UTC
ok, understood. 
it confuses me when i must fill multiple documents from a void original copy, but it's ok, just another point of view.

i wrote a a dolphin services that quickly clear the file cache to speed up my work.
thankyou all.

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin,inode/directory,inode/directory-locked
MimeType=application/pdf;application/x-pdf;
Icon=application-pdf

Actions=Cache_clear;
X-KDE-Priority=TopLevel

[Desktop Action Cache_clear]
Name=Okular cache cleaner
Comment=Cancella la cache di okular
Exec=konsole -e rm ~/.kde/share/apps/okular/docdata/*.%n.xml &
Icon=application-pdf