Repository navigation
refactor(kernel): build the catalog once for Save and the signing path (#606) - #635
Merged
Merged
Conversation
…#606) Save and the signing path assembled the catalog in separate blocks that disagreed on key order and on where the output-intent objects are numbered. One builder now writes the keys from references each path has already reserved, so no output changes and no refusal moves. A test seam lets the catalog parts that later issues add be checked on both paths.
…atalog comments No golden had form fields under an untagged PDF/A level, so a builder that wrote /OutputIntents before a late /AcroForm only for an untagged document passed every case. form-pdfa2u adds one to the Save and signing tables; the values were recorded from main and the branch gives the same ones. The catalog builder comments now state what holds today, name the actual /AcroForm placement rule, scope the seam's claim to the pinned configurations, and list PDF/UA-1 and the CMYK output intent where the carried-over comments left them out.
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.
Closes #606
PdfDocument.Saveand the signing path (PrepareForSigning) each assembled the catalog in their ownblock, and the two blocks disagreed on key order and on where the output-intent objects are numbered.
One private
BuildCatalog(CatalogParts)now writes the keys. It reserves nothing and calls nothingthat reserves; each path computes its references where it did before and passes them in.
AcroFormFollowsMetadatais a parameter, not a branch on the caller:Savewrites/AcroFormafterthe last of
/Outlines+/PageMode,/MarkInfoand/StructTreeRootthat is present, the signing pathright after
/Metadata. It exists only for byte identity.BuildOutputIntentsimmediately before the builder, which keeps the objectnumbers of the old inline call.
_written = trueand every refusal stay where they were. The builder throws nothing.PdfDocument.CatalogExtraEntries(null by default): entries are appended afterevery other key on both paths. No public API change.
No output changes. The 63
CatalogGoldenTestscases from #626 pass with their expected valuesuntouched; nine tests are added to that class (seam on both paths and through an object stream, and a
retry after a precondition refusal on each path, compared with the golden hash), and a
form-pdfa2uconfiguration (a text field under untagged PDF/A-2u) is added to the Save and signing tables, six more
cases. Its hashes and catalog text were recorded from main at 2027421 and the branch gives the same.
Gates (Release,
REQUIRE_ORACLES=1, qpdf 12.4.2, veraPDF 1.30.4)Build 0 warnings;
dotnet format --verify-no-changes,eng/clean-room-check.ps1andgenerate-roadmap.py --checkpass. The Layout and Reader skips are not from a missing oracle, whichfails under
REQUIRE_ORACLES; I did not trace them.Mutations (net10.0, rebuilt DLL each time, source restored afterwards)
DisplayDocTitleAcroFormFollowsMetadata: falseSavewrites an empty/AcroFormwhen there is none/OutputIntentsbefore a late/AcroForm, only when untaggedform-pdfa2u; no other case fails, which is why the configuration was neededMarkInfoafterStructTreeRootNot run: a veraPDF
--flavour 2ucase; the class has none and the key order is not what veraPDF checks.