8 years ago, when dropping XFA was introduced in #1008422: pdftk: Need to drop XML Forms Architecture (XFA) data from filled PDFs, flattening wasn't optional in pdftk.
Later, some 5 years ago, flattening became optional in #920766: Allow non-flattening option. XFA forms however remain to be always removed in pdftk, no matter whether the file is flattened or not.
FillPDF LocalServer, on the other hand, removes XFA forms only when flattening. This seems to be the correct approach. Finally, who wants the populated PDF to be fillable, will expect XFA forms to be kept as well.
At least pdftk and FillPDF LocalServer should produce the same results. While both approaches might be seen as having some merit, the inconsistency makes this a bug.
We just need to take into account what @wizonesolutions initially raised in #1008422: pdftk: Need to drop XML Forms Architecture (XFA) data from filled PDFs:
Currently, when pdftk fills PDF fields in LiveCycle-created PDF forms, it may leave behind what is called XML Forms Architecture data.
In short, this makes the PDF behave incorrectly in Adobe Reader - generally, it will not be flattened, and the fields will never be filled in correctly.
pdftk can drop XFA data, so this needs to be done for the pdftk fill method to ensure module functionality.
Note that this however describes a situation where the PDF is flattened (finally that was non-optional back then), but the XFA not removed.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | fillpdf_pdftk_drop_xfa_only_when_flattening_3056313-10.patch | 973 bytes | wizonesolutions |
Comments
Comment #2
panchoHere's a patch.
For proper testing, we need to be able to #3039828: [PP-1] Detect whether a PDF template contains XFA forms, though.
Comment #3
panchoThis is what the PDFTK manual says:
I can’t really imagine what is meant with “fails to display”. And does the problem only occur if populated by pdftk? We might have to try out Acrobat 7 to see how it actually looks like.
Comment #4
wizonesolutionsFine with this as-is. I'm not worried about Acrobat 7, and even then, we're still removing, just when flattening. That's fine.
Comment #5
panchoSorry, but as-is is the only way that can't be correct, see the OP:
IMO, we have two legitimate options here:
Comment #6
wizonesolutionsLet me clarify: fine with the patch as-is, which is to
drop_xfawhen flattening with PDFtk.Comment #7
panchoLOL, okay, sorry, I misunderstood you indeed. :)
Comment #8
panchoI guess I may unassigned you.
Comment #9
wizonesolutionsIs there a blocker for committing this?
Comment #10
wizonesolutionsRe-rolled this patch.
Comment #11
wizonesolutions