Bug 99141

Summary: pdfunite filled-out form data lost
Product: poppler Reporter: Andreas Gruenbacher <andreas.gruenbacher>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: A very simple pdf form (created with OpenOffice)
A filled-out version of form.pdf
Broken pdfunite result
add fields to AcroForm dict

Description Andreas Gruenbacher 2016-12-19 04:47:59 UTC
When I fill out a pdf form and save it with evince (i.e., saving instead of printing to file), the saved document contains the filled-out form data but the form remains fillable.

When I concatenate several such filled-out forms with pdfunite, the first form remains filled out, but the other forms return to their blank state.

When I print to file instead, things work as expected, but the result is no longer fillable.

(pdf forms to demonstrate this with are easy to come by, google "pdf form example" for example.)
Comment 1 Albert Astals Cid 2016-12-19 16:01:35 UTC
If it's so easy to come by, i'm sure it'll be easy for you to get one and attach it here, also describe exactly the steps to reproduce your problem because it's not clear enough for me.
Comment 2 Andreas Gruenbacher 2016-12-19 16:13:53 UTC
Created attachment 128552 [details]
A very simple pdf form (created with OpenOffice)
Comment 3 Andreas Gruenbacher 2016-12-19 16:14:49 UTC
Created attachment 128553 [details]
A filled-out version of form.pdf
Comment 4 Andreas Gruenbacher 2016-12-19 16:17:17 UTC
Created attachment 128554 [details]
Broken pdfunite result

Created with:

  pdfunite filled-out-form.pdf filled-out-form.pdf pdfunite.pdf

Note that the form on page two is blank but it should be filled out.
Comment 5 Thomas Freitag 2017-01-06 14:38:04 UTC
Created attachment 128794 [details] [review]
add fields to AcroForm dict

This patch is probably not complete, it just adds the document root fields and probably should also merge resource dictionaries, but since I have no good examples to test the correct result I don't want to spend time on it. At least this patch solves the described problem.
Comment 6 Albert Astals Cid 2017-01-08 23:26:31 UTC
Pushed
Comment 7 Andreas Gruenbacher 2017-01-09 10:19:58 UTC
Thanks, the fix works for me.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.