Repository navigation
Description
The document catalog in this library never gets a /Names key. That single gap blocks three
separate features, so the name tree is the foundation the rest of v2.7 stands on.
Verified: searching the writer for Names finds only AcroForm field /T name strings and font
resource names (PdfDocument.cs:55-59, :399-491, :720) — nothing that writes a name tree.
What is blocked by it
| Consumer | Clause | Issue |
|---|---|---|
/EmbeddedFiles |
7.11.4 | A2 — attachments have nowhere to live |
/Dests |
12.3.2.3 | B14 — named destinations |
/PageLabels |
12.4.2 | B14 — and PDF/UA-2 §8.12.3 requires page labels when a page's number differs from its index |
/JavaScript, /AP, /Templates, /IDS, /URLS, /Renditions |
7.9.6 Table 33 | not in scope, but the tree serves them |
What to build
A balanced name tree per ISO 32000-2:2020, 7.9.6: /Kids for interior nodes, /Names for leaves,
/Limits on every node but the root, keys sorted by byte value. The sort is not cosmetic — a reader
is entitled to binary-search it, so an unsorted tree is silently wrong rather than merely untidy.
Worth deciding here rather than per-consumer: whether the tree is always written as a single leaf
below some size threshold. Small documents get a one-node tree either way, and a threshold keeps the
common case readable.
Acceptance
- Trees of 1, 2, 100 and 10 000 entries all round-trip through
VellumPdf.Reader. /Limitscorrect at every level, verified against the actual key range of each subtree.- Keys sorted by byte value, including non-ASCII keys — a UTF-16 or culture-aware sort is a bug.
qpdf --checkclean, andqpdf --jsonshows the tree structure the test expects.
Relates to
- A2 — embedded files, the first consumer.
- B14 — page labels and named destinations.
- Epic: edit existing PDF documents (read-modify-write) #101 / v3.4 — merging two documents means merging their name trees, which is where the real
difficulty in K2 lives.
Plan labels used above, resolved: A2 #242 · B14 #262 · K2 #343.
Activity
feat(kernel): internal name-tree and number-tree writers (#622)