Opened 12 years ago
Last modified 11 years ago
#2541 assigned defect
Read can't save a PDF with a form
Reported by: | godiard | Owned by: | godiard |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Read | Version: | Git as of bugdate |
Severity: | Unspecified | Keywords: | |
Cc: | godiard, sascha_silbe, humitos | Distribution/OS: | |
Bug Status: | New |
Description
Read can open a PDF with a form and write it, but can't save the modified file with the text added.
Tested in Sugar 0.84
The attached file can be used for testing
Attachments (1)
Change History (6)
Changed 12 years ago by godiard
comment:1 Changed 12 years ago by sascha_silbe
- Cc sascha_silbe added
- Distribution/OS Unspecified deleted
- Milestone changed from 0.84 to Unspecified by Release Team
- Owner changed from sayamindu to godiard
- Status changed from new to assigned
- Version changed from Unspecified to Git as of bugdate
This is a limitation of PDF that we'd need to work around by
- saving the entered values as part of the metadata (=> not preserved outside of Sugar) and
- saving a permanently modified version.
- requires upstream (i.e. libevview) support first.
- would need to be an explicit user action since the original document wouldn't be recoverable from the filled-out version. But unlike 1. it can be implemented using the current evince API: by "printing" to a file.
Note that at least evince 2.30.2 has a bug that causes it to not render fields that have been filled out, but not "left" (by clicking on a different part of the document) before printing. We might need to work around this in Read.
In theory 1. would be an enhancement, but since not preserving changes across Stop/resume is violating the HIG I'll leave it marked as defect.
comment:2 Changed 12 years ago by sascha_silbe
I just discovered that Okular (the PDF viewer shipped with KDE) is able to save a filled-in PDF form that can be modified again. So it seems there is some way to do that in the PDF format; my original analysis was incorrect.
Even better, evince apparently already supports it (https://bugzilla.gnome.org/show_bug.cgi?id=480668|Gnome#480668. Just checked with evince 2.30.3-2 (Debian Squeeze) and using "Save a copy" indeed saves the filled-out form values, too! (when it doesn't segfault, that is :-/ )
We probably only need to use the evince.Document.save() function instead of the hard linking trick in readactivity.ReadActivity.write_file().
comment:3 Changed 11 years ago by humitos
- Cc humitos added
comment:4 Changed 11 years ago by humitos
Well, I used pdfinfo command to get some information about "formulario.pdf":
[humitos] [~]$ pdfinfo formulario.pdf Producer: Python PDF Library - http://pybrary.net/pyPdf/ CreationDate: Sat Oct 23 16:09:11 2010 ModDate: Sun Dec 5 20:23:18 2010 Tagged: no Pages: 3 Encrypted: no Page size: 611.827 x 791.841 pts File size: 176528 bytes Optimized: yes PDF version: 1.6 [humitos] [~]$
I found this file was created with pyPdf, so should be there a way to extract the filled in information. I'm researching about this.
PDF with a form