Skip to content

Kernel: Figure and Table structure elements carry no /BBox layout attribute #587

Open

Description

@Tim81

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-80 lists the element's members: Page, Mcid,
    AltText, Language, TableHeaderScope, TableRowSpan, TableColSpan and children; none is a box.
  • A search of src/VellumPdf.Kernel and src/VellumPdf.Layout for "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 /A dictionary 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 /A array).
  • Layout: LayoutImageRenderer and TableRenderer fill 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 Table spans 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 Figure carries a /BBox equal to the image's page rectangle; a single-page Table likewise
    (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.

Relates to

Activity

  1. added
    enhancement
    area/conformance
    area/layout
    type/feature
    on Nov 18, 2026
  2. Tim81 commented on Nov 29, 2026

    @Tim81
    OwnerAuthor

    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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/conformancearea/layoutenhancementtype/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions