Skip to content

Say when the XML is the whole form, and hand it over - #9

Merged
tannevaled merged 1 commit into
mainfrom
say-when-xfa-is-the-whole-form
Aug 30, 2026
Merged

Say when the XML is the whole form, and hand it over#9
tannevaled merged 1 commit into
mainfrom
say-when-xfa-is-the-whole-form

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

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.

What measuring against the corpus found

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.

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.
@tannevaled
tannevaled merged commit 39dae2a into main Aug 30, 2026
1 check passed
@tannevaled
tannevaled deleted the say-when-xfa-is-the-whole-form branch August 30, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant