Repository navigation
Description
This is a defect in output shipping today, not new work.
DocumentRenderer splits an element that does not fit: LayoutResult.Partial(occupied, split, overflow) (LayoutResult.cs:51) returns two renderers, and each is drawn separately. Meanwhile
ParagraphRenderer.cs:214 creates the structure element inside Draw:
var elem = new PdfStructElem(StructType) { Mcid = mcid };So a paragraph that crosses a page break produces two P structure elements, not one.
TableRenderer.cs:147 does the same with tableElem = new PdfStructElem("Table"), so a table spanning
pages produces two Table elements.
Why it matters
PDF/UA-2 §8.2.2 forbids exactly this, and uses exactly this example:
Real content that is typically represented by a single semantic structure element with intrinsic
semantics shall not be represented by several such structure elements of the same structure type.
with the specification's own illustrations being one Table for a table spanning pages and one P for
a paragraph spanning pages or columns.
PDF/UA-1 does not state the rule this explicitly, which is presumably why the ua1 oracle passes
today. It will not pass ua2, and more importantly the output is wrong for a screen-reader user
regardless of which profile is being claimed: a paragraph read as two paragraphs is a real defect.
The fix changes the renderer contract
The structure element must be owned by the logical element and shared across its fragments, rather
than created per Draw call. That means:
- an element's structure element is created once, at the point the element is laid out;
- each fragment contributes its own MCID to that one element — a structure element can reference
content on several pages through/Kentries with/Pg; StampStructElemPage(DrawContext) currently stamps one page onto one element, which is the
single-page assumption made concrete and will need to become per-MCID.
Every renderer that creates structure elements is affected: ParagraphRenderer, TableRenderer,
ListRenderer, LayoutImageRenderer, PieChartRenderer.
Acceptance
- A paragraph spanning a page break produces one
Pelement with content items on both pages. - A table spanning a page break produces one
Table. - A list spanning a page break produces one
L, with theLIthat straddles the break also intact. - veraPDF
ua1stays green, and the fixture is reusable forua2in v2.12. - The structure tree is asserted directly, not inferred from the oracle passing.
Relates to
- Layout B — the element set that depends on structure elements being correct.
- Conformance: PDF/UA-2 (ISO 14289-2:2024) rule set #275, Conformance: PDF/UA-2 structure and namespace rules #276 — the PDF/UA-2 rules this satisfies.
- Layout: hardening (rowspan across page break, WordWrap newline/whitespace, justified spacing, image NaN, markers) #84 — the earlier table page-break hardening.
Activity
Tim81 commentedon Nov 18, 2026
Adds current line numbers, the split-
LI-without-Lbldetail and measured proof. The list case and the directstructure-tree assertion are already in this issue's acceptance.
The line numbers in the description have moved. On origin/main 1c61fa6 the per-fragment elements are created at:
ParagraphRenderer.cs:328(var elem = new PdfStructElem(StructType) { Mcid = mcid };), once perDraw;TableRenderer.cs:224-226(tableElem = new PdfStructElem("Table")), once perDraw;ListRenderer.cs:200-202(listElem = new PdfStructElem("L")). The item that was split gets a newLIwithout a
Lblon the continuation page (:211setsisContinuation,:226-236buildsLI, and theLblonlyif (!isContinuation)).For the list case in the acceptance: a list over a page break gives two
Lelements, and the split item gives twoLIelements, the second withoutLbl.Measured in the 2026-11-16 handbook research on VellumPdf 2.3.3: a 90-row table became five
Tableelements(pages 1 to 5); the last filler paragraph became
P mcid=13 pg=5andP mcid=0 pg=6; a 158-page document with 20split tables passed veraPDF
ua1and the library's preflight.Why the fix needs a Kernel change first:
PdfStructElemhas onePageand oneMcid(PdfStructureTree.cs:18,:24),/Kis either an MCID or an array of children (:260-273), and the ParentTree is built per page from theelements on that page (
:168-215).DrawContext.StampStructElemPagestamps one page on one element(
DrawContext.cs:318-322). A multi-page element needs mixed kids with a per-kid page: #604.Details to add to the acceptance:
/Pgof the page that differs), and theParentTree entries of both pages point to the same element;
IRendererimplementations keep working:RegisterStructElem,RegisterStructElemTreeandStampStructElemPageare shipped members and stay; the per-MCID path is new and internal.Dependent items: #582 (repeated header rows) and #589 (empty cells) assume this lands first.
test: pin structure and artifact output to its ISO clauses (#761)