Repository navigation
Description
Problem
PdfStructElem has no layout attributes, so a Figure or Table is written without
/A <</O /Layout /BBox [...]>>. (origin/main 1c61fa6.)
src/VellumPdf.Kernel/Document/PdfStructureTree.cs:12-80lists the element's members:Page,Mcid,
AltText,Language,TableHeaderScope,TableRowSpan,TableColSpanand children; none is a box.- A search of
src/VellumPdf.Kernelandsrc/VellumPdf.Layoutfor"BBox"finds only form-widget appearance
streams (Forms/AcroFormBuilder.cs:545,:565,:582), none in the structure tree writer. - Cell attributes are already written as an
/Adictionary with/O /Table(documented at
PdfStructureTree.cs:39-60), so an attribute dictionary exists to model a second owner on.
Why it matters
The findings file cites ISO 32000-1 14.8.5.4.3, Table 344: BBox for Figure, Formula and Table when the
content is to be reflowed. Reflow and some screen magnifiers use it, and the findings file says it is not a PDF/UA-1 machine rule (taken from
the findings file; the clause and the veraPDF profile were not re-read for this draft).
What this takes from #272
#272 (v2.11) covers the general /A attribute-object mechanism: its table lists "/A attribute objects, 14.7.6" with the
owners it cares about (ARIA-1.1, FENote) and the other missing structure entries. #587 needs only one owner
now, Layout with /BBox for Figure and Table, because reflow data is useful today. It must not fix the shape of
#272's API: the new member is the smallest addition that writes /O /Layout /BBox, and #272 may generalise or replace
it later.
Scope
- Kernel: an additive
PdfStructElem.BoundingBox(default user space of the element's page) written as
/A <</O /Layout /BBox [llx lly urx ury]>>, written next to any other attribute dictionary the same element
already has (the brief states how several owners are combined: one/Aarray). - Layout:
LayoutImageRendererandTableRendererfill it from the occupied area, converted with
ToPdfRect. - Open point for the brief: after Layout: a page-split element emits one structure element per fragment #285 one
Tablespans pages, and a single box cannot cover content on
several pages. The brief settles it against ISO 32000-1 14.8.5.4 (for example omit the box on a multi-page
table, or write one per fragment through a per-kid attribute). This draft does not decide.
Acceptance
- Every
Figurecarries a/BBoxequal to the image's page rectangle; a single-pageTablelikewise
(assert the four numbers). - An element without a box writes the bytes it writes today (golden test).
- The box is in default user space of the element's page (Y up), not layout space (a test places the element
away from the origin). - The test fails on origin/main 1c61fa6, proven by mutation.
Activity
test: answer the review of the structure and artifact audit
test: fix the second review of the structure and artifact audit
test: pin structure and artifact output to its ISO clauses (#761)
Tim81 commentedon Nov 29, 2026
The ISO audit (
docs/conformance-v2.4.md) has skipped tests that wait on this issue; the fix removes their skip and makes them pass.Iso32000_1_14_8_5_4_3_ATableThatFitsOnOnePageCarriesItsBBox(group G3)