Say when the XML is the whole form, and hand it over - #9
Merged
Conversation
XFA came in two kinds and this package treated them as one. Measured over 2 240 real government forms: 1 499 carry a form, 560 of those carry an XFA package, and 546 of those are STATIC — a second, proprietary description of a form that is already there. The pages are drawn, the widgets exist, everything here works on them, and reading the harder description gains nothing. That was the whole of what the package documentation said, measured over 68 forms. The other fourteen are DYNAMIC. Their pages hold a panel reading "Please wait... your PDF viewer may not be able to display this type of document", and the form is laid out from the XML when it is opened — by Adobe's reader and by nothing else, the format having been removed from PDF 2.0. A caller meeting one has a document that looks blank and is not, and every tool including this one drew nothing and said nothing about it. Dynamic says which kind. Packets hands back the parts of the package, so the values a form was filled with can be read: they live in the datasets part, as ordinary XML. Measuring against the corpus is what found the flaw in the shape of it. The library answered "none dynamic" where the corpus said fourteen, because Read refuses a form with no fields — and a dynamic XFA form usually HAS no AcroForm fields, its fields being in the XML. The documents most needing to be reported were exactly the ones being refused. An empty field list with no XFA is still no form, which is the common case: 561 of the 118 833 files in the figure corpus carry an AcroForm a producer left behind. An empty one WITH a package is a form whose fields live elsewhere. With that, the library's count matches the corpus exactly: 560 packages, 14 dynamic, and the XML of all 560 read. 100% statement coverage, go vet and -race clean, nine cross-compile targets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XFA came in two kinds and this package treated them as one.
Measured over 2 240 real government forms: 1 499 carry a form, 560 of those carry an XFA package, and 546 of those are static — a second, proprietary description of a form that is already there. The pages are drawn, the widgets exist, everything here works on them, and reading the harder description gains nothing. That was the whole of what the package documentation said, measured over 68 forms.
The other fourteen are dynamic. Their pages hold a panel reading "Please wait... your PDF viewer may not be able to display this type of document", and the form is laid out from the XML when it is opened — by Adobe's reader and by nothing else, the format having been removed from PDF 2.0. A caller meeting one has a document that looks blank and is not, and every tool including this one drew nothing and said nothing about it.
Dynamicsays which kind.Packetshands back the parts of the package, so the values a form was filled with can be read: they live in thedatasetspart, as ordinary XML.What measuring against the corpus found
The library answered "none dynamic" where the corpus said fourteen — because
Readrefuses a form with no fields, and a dynamic XFA form usually has no AcroForm fields, its fields being in the XML. The documents most needing to be reported were exactly the ones being refused.An empty field list with no XFA is still no form, which is the common case: 561 of the 118 833 files in the figure corpus carry an AcroForm a producer left behind. An empty one with a package is a form whose fields live elsewhere.
With that, the library's count matches the corpus exactly: 560 packages, 14 dynamic, and the XML of all 560 read.
100% statement coverage,
go vetand-raceclean, nine cross-compile targets.