After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 480668 - save user input in pdf fillable forms
save user input in pdf fillable forms
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: PDF
git master
Other All
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-09-26 16:47 UTC by michal
Modified: 2010-03-17 07:21 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
PDF form that fails to save filled (84.80 KB, application/pdf)
2009-05-11 18:22 UTC, Liquider
Details

Description michal 2007-09-26 16:47:07 UTC
It would excellent if the user input fields on fillable pdf forms could be saved someway.  Ideally (not knowing anything about how difficult this might be), this data would simply be saved into the pdf file when 'save a copy' was selected.

If that's not possible, perhaps there could be a menu option to 'Save filled data' to a separate file that contained a pointer to the pdf file and the input data?
Comment 1 Carlos Garcia Campos 2007-09-28 10:05:57 UTC
Saving filled data to pdf file is not supported by poppler yet. When it is supported will have to think how to expose it in the evince UI. Maybe we can just use the current save a copy action. 

Thanks for reporting. 
Comment 2 James Cloos 2007-10-02 17:15:59 UTC
The save a copy action is indeed the Right Way™.

You’d most likely want a simple toggle, visible only when necessary, to choose whether the copy should be pristine or include the current user data.

To the OP, note that printing to a PDF or PS is almost the same as saving a flattened copy.
Comment 3 Alex Lancaster 2007-10-14 09:46:57 UTC
It seems that whoever wrote the release notes for GNOME 2.20:

http://www.gnome.org/start/2.20/notes/en/index.html#rnusers-evince

oversold the current capabilities of evince, because it implies that saving user input back to the PDF file is already implemented:

"GNOME's Evince viewer, for PDF and Postscript files now supports interactive PDF forms, allowing you to enter information into a PDF that you receive, to save or print."

Clearly "save" is wrong in this context.  It probably wasn't an evince developer who wrote that, but maybe contact the release notes writers to change that otherwise users are going to be disappointed that the advertised feature is not actually there yet (I know I was... ;-))
Comment 4 Carlos Garcia Campos 2008-01-29 09:47:07 UTC
This is already supported by poppler (git master version). Right now, saving a copy will always save the contents of the form fields if there are changes. I'm not sure whether it would be better to use save and save as instead of save a copy. Or maybe just add a checkbox to save filechooser to be able to choice whether save the contents fo the form fields or not. 
Comment 5 Elias K Gardner 2008-03-17 17:14:10 UTC
currently in evince 2.22.0 filled out forms show up when printed but cannot be saved.
Comment 6 Carlos Garcia Campos 2008-03-18 09:24:36 UTC
You need poppler >= 0.7.0
Comment 7 Frederik Elwert 2008-07-14 14:21:39 UTC
I think the second way proposed in the initial description would also have it's own benefits. The PDF spec describes the FDF format to save PDF form data separate from the PDF itself. There also exists an XML version called XFDF. I think it would be very valuable if evince could save forma data into FDF or XFDF files (the latter might be easier to handle, since they are XML, not binary) and load X/FDF data back into a PDF form.

This has the benefit that for different versions of one form one would not need to keep several copies of the PDF file, but could have one PDF form with multiple data files.

Should I open a new feature request for this, or is this place correct (since this actually is a solution to the problem described above)?
Comment 8 Adam Buchbinder 2008-12-12 14:34:58 UTC
This appears to be done in the version of Evince (2.24.1) and Poppler (0.8.7) that have shipped with Ubuntu Intrepid--filling out a form and selecting 'File->Save a Copy' saves the filled-in form as it should. I believe this task can be closed.
Comment 9 Carlos Garcia Campos 2008-12-12 16:45:29 UTC
Well, it's still open because of the discussion about the save, save as and save a copy
Comment 10 Liquider 2009-05-11 18:22:27 UTC
Created attachment 134428 [details]
PDF form that fails to save filled
Comment 11 Liquider 2009-05-11 18:25:02 UTC
libpoppler3 0.8.7
libpoppler4 0.10.5
evince 2.26.1
Xubuntu 9.04

Saving attached pdf file - forms filled - produces a 0B (empty) file.
Reproducible.
Comment 12 Adam Buchbinder 2009-05-11 20:42:07 UTC
Liquider, that's because the document you attached is encrypted; your report is a duplicate of bug 564268. It's a poppler bug, and it's fixed in version 0.10.6. (Using that version puts up an error message when the file can't be saved.)
Comment 13 Frederik Elwert 2009-11-19 19:56:10 UTC
The request to support (X)FDF is probably a separate issue. I filed it as bug #602441.
Comment 14 Victor Engmark 2010-03-16 10:22:08 UTC
(In reply to comment #8)
> This appears to be done in the version of Evince (2.24.1) and Poppler (0.8.7)
> that have shipped with Ubuntu Intrepid--filling out a form and selecting
> 'File->Save a Copy' saves the filled-in form as it should. I believe this task
> can be closed.

Still an issue with Evince 2.28.1 using poppler 0.12.0 (cairo). How to reproduce:
1. Download an official income tax declaration for Geneva, Switzerland: http://ge.ch/impots/portal/jcr?workspace=EtatDeGenevePublie&path=/afc/documents/IS/2010/IS%20decla10_fr.pdf
2. Edit the "Nom" field
3. Ctrl-S
4. Alt-S (Saving the file to the desktop)
5. Open the new file with Evince

The text entered is not in the new file. Also, if I try to save the edited file over the original, Evince crashes.

Please reopen this bug.
Comment 15 Victor Engmark 2010-03-16 10:27:54 UTC
Reported crash as bug 613025.
Comment 16 Victor Engmark 2010-03-16 12:28:49 UTC
More info / work-around:
1. Saved http://ge.ch/impots/portal/jcr?workspace=EtatDeGenevePublie&path=/afc/documents/IS/2010/IS%20decla10_fr.pdf as form.pdf
1. Ran `sudo apt-get install acroread`
2. Opened the document in Adobe Reader 9. It said that "You cannot save data typed into this form." I checked the document restrictions summary, and it says "Filling of form fields: Allowed", which seems to contradict the previous statement.
3. Ran `pdftk form.pdf output new.pdf allow FillIn`
4. Opened new.pdf in Adobe Reader 9. Still got the same message about being unable to save form data.
5. Opened new.pdf in Evince, modified form data, and saved. This time it worked fine!

Looks like Evince actually works better than Adobe Reader 9, and that something is strange with the document restrictions in the original document.
Comment 17 Adam Buchbinder 2010-03-16 23:09:27 UTC
Victor, the permissions on the file are, in fact, not broken. See the PDF 1.5 spec (http://www.adobe.com/devnet/pdf/pdfs/PDFReference15_v6.pdf), table 3.20 starting on page 98. Filling out form data is a permission bit unto itself, separate from printing or saving a document; there are plenty of forms out there designed to be filled and printed rather than filled and saved. (This strikes me as more than a bit silly, but it's the way the system is set up.) The crash, of course, was definitely a bug.
Comment 18 Victor Engmark 2010-03-17 07:21:48 UTC
Thanks for the clarification, Adam.