Carry the reading order across, not just the pages - #3
Merged
Conversation
ops v0.6.0 -> v0.7.0, which keeps /StructTreeRoot; reader v0.4.2 -> v0.5.0. A structure tree is the order a screen reader reads a document in. It is not the order the marks sit on the page, and nothing else in the file says it. Plan.Build was writing a document without one, so a tagged form put through a shared edit came out untagged: still legible to somebody looking at it, and no longer navigable by somebody who cannot. Measured over the 1 633 real documents in /Users/Shared/pdfforms, both binaries verified with `go version -m`: 1 021 source documents carry a /StructTreeRoot. ops v0.6.0 carried 0 of them into the rebuilt document. ops v0.7.0 carries 1 014. 3 095 top-level structure elements come across, with the ParentTree, the RoleMap, the ClassMap and the IDTree that make them mean anything. The seven not carried across all have a root with no /K -- a ClassMap and a RoleMap and no tree under them. There is nothing in them to carry, which is the same shape as an AcroForm dictionary with no fields, so 1 014 of 1 014 actual trees are preserved. Over all 2 268 files, 1 096 build a different document and 0 build a worse one; no file changed whether it opens or builds.
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.
opsv0.6.0 → v0.7.0,readerv0.4.2 → v0.5.0. No code change.A structure tree is the order a screen reader reads a document in. It is not the
order the marks sit on the page, and nothing else in the file says it.
Plan.Buildwas writing a document without one, so a tagged form put through ashared edit came out untagged: still legible to somebody looking at it, and no
longer navigable by somebody who cannot.
Measured
Two binaries, each verified with
go version -m. The harness puts every pageof a file into a plan, rotates the first page, adds a bookmark, builds, writes,
reads the result back and reports what the rebuilt catalogue says:
Corpus: all 2 268 forms in
/Users/Shared/pdfforms. Prevalence is over the1 633 real documents.
/StructTreeRootopsv0.6.0opsv0.7.0One catalogue, verbatim,
ca-cra/gst190-fill-26e.pdf:It is the whole tree and not an empty shell: the
ParentTree, theRoleMapandthe
IDTreethat make the elements mean anything all come across with it.Over all 2 268 files: 1 096 build a different document, 1 096 of them larger, 0
smaller, and no file changed whether it opens or whether it builds.
The seven
1 021 sources carry a root and 1 014 come across, so seven do not. All seven have
a root with no
/K— aClassMap, aParentTree, aRoleMap, and no treeunder them:
There is nothing in them to carry. That is the same shape as an
AcroFormdictionary with no fields in it, which this family already declines to treat as a
form. So 1 014 of 1 014 actual trees are preserved, and I would not want the
other seven "fixed" by writing an empty root into the output.
Not measured
Wall clock and peak memory. Three other corpus jobs were running on this machine,
so a timing figure would be fiction. The output diff is unaffected by load.
Gates
go vet,gofmt, exact 100% statement coverage, nine cross-compile targets, allpass locally with
GOWORK=off CGO_ENABLED=0.