Skip to content

Kernel: structure namespaces — /Namespaces, /NS and /RoleMapNS #271

Open

Description

@Tim81

PDF 2.0 introduced structure namespaces (14.7.4, 14.8.6) so a document can carry tags from more than
one vocabulary and role-map between them. None of it is written today: PdfStructElem has no /NS,
and /Namespaces and /RoleMapNS appear nowhere.

Everything else in v2.11 and v2.12 depends on this, because PDF/UA-2 §8.2.5.2 requires the
Document structure element to be explicitly in the PDF 2.0 namespace
— so a conforming file cannot
avoid namespaces even if it uses only PDF 1.7 tags elsewhere.

Scope

  • /Namespaces — an array of namespace dictionaries on /StructTreeRoot.
  • Namespace dictionaries: <</Type /Namespace /NS (uri) /RoleMapNS … /Schema … >>.
  • /NS on structure elements.
  • /RoleMapNS, for mapping a custom type into a standard namespace. Role mapping may be transitive,
    and PDF/UA-2 §8.2.4 forbids mapping a type to another type in the same namespace — worth
    enforcing rather than trusting.

The URIs, verified against the specification itself

Full-text search of ISO 32000-2:2020 returns exactly these three:

Namespace URI
PDF 1.7 http://iso.org/pdf/ssn
PDF 2.0 http://iso.org/pdf2/ssn
MathML http://www.w3.org/1998/Math/MathML

Cite §14.8.6 for these, not the examples elsewhere. Neither ISO/TS 32005 nor ISO 14289-2 states
them in normative text — TS 32005 contains no occurrence of the strings at all, and PDF/UA-2's only
literal appearance is inside the §8.2.6.4 code example. A citation to an example is not a citation to a
requirement.

Version obligation

ISO/TS 32005 §5.1: a document conforming to it shall be versioned as PDF 2.0, via the header or the
catalog /Version. So using namespaces pins the version, which ties directly to #223's work.

Acceptance

  • A structure tree with elements in both the PDF 1.7 and PDF 2.0 namespaces, round-tripping.
  • A custom namespace role-mapped into PDF 2.0, including a transitive mapping.
  • A same-namespace role mapping rejected.
  • The three URIs asserted as exact byte strings.
  • veraPDF ua1 stays green — namespaces are additive to a PDF/UA-1 file.

Relates to


Plan labels used above, resolved: G2 #272 · G4 #274.

Activity

  1. added
    area/conformance
    type/feature
    on Aug 29, 2026
  2. Tim81 commented on Nov 27, 2026

    @Tim81
    OwnerAuthor

    A consumer once this lands: the note block of #721 tags its box Div in every file, because the Kernel cannot yet write Aside with the PDF 2.0 namespace. An Aside written without /NS falls in the default (PDF 1.7) namespace, where it is a non-standard type with no role mapping (ISO 32000-2 14.8.6.1 and 14.8.6.2; ISO/TS 32005 5.4 requires PDF 2.0 elements to declare their namespace), and veraPDF's WTPDF profile reports it under rule 8.2.4-1. When /Namespaces and /NS exist, a PDF 2.0 file should tag the note block Aside in the PDF 2.0 namespace (ISO 32000-2 14.8.4.4: callouts are an example of Aside).

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/conformancetype/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions