Skip to content

Layout: under a PDF/UA-1 claim a first heading below H1, or a skipped heading level, saves a file veraPDF refuses #767

Backlog

Description

@Tim81

Why

ISO 14289-1, 7.4.2: in a document that is not strongly structured, "H1 shall be the first" heading, and a descending
sequence "shall not skip an intervening heading level". Layout writes Heading.Level as given (level 0 is H1, and so
on), so the caller's levels decide whether the file conforms.

Measured at 850a8e9 (origin/main b2791ba plus test-only commits), PDF/UA-1, DejaVu Sans from the tree, veraPDF 1.30.4
--flavour ua1:

Headings added Structure written veraPDF ua1
Level = 2, then Level = 0 H3, H1 fails 7.4.2-1 (ConformanceAuditG3Tests.Iso14289_1_7_4_2_AFirstHeadingBelowLevelOneIsWrittenAsGivenAndVeraPdfRefusesTheFile)
Level = 0, then Level = 2 H1, H3 fails 7.4.2-1 (probe, not in the suite)
Level = 0, then Level = 1 H1, H2 passes (the G3 main fixture)

Save does not report either failing file. veraPDF's PDFA-2A profile has no heading rule (its 6.7 rules are 6.7.2.2-1,
6.7.3.3-1, 6.7.3.4-1 to -3 and 6.7.4-1), so the case is UA-1 only; the 2a files were not run.

Sweep: Layout is the one package that writes Hn (ParagraphRenderer through Heading); git grep -n 'PdfStructElem("' -- src at 850a8e9 shows no other heading writer. A Kernel caller who builds H3 by hand under UA-1 gets the same file,
which is #474's general case and stays there.

Proposal

Under a PDF/UA-1 claim, Document.Save reports a heading through the diagnostics channel (#607) when it is the
first heading of the document and its level is not 0, or when it is more than one level below the heading before it.
The report names the heading text, its level and ISO 14289-1 7.4.2; strict mode refuses the save. Without the claim,
and under PDF/A, nothing is reported. The headings are written as today in every case. Document the report on
Heading.Level and on the diagnostic code.

Acceptance

  • The skipped test Iso14289_1_7_4_2_AFirstHeadingBelowLevelOneIsRefusedOrReportedUnderThePdfUa1Claim runs and passes
    (reported, and refused under strict mode), and a second case covers H1 then H3.
  • Without strict mode the file keeps its bytes; the pin Iso14289_1_7_4_2_AFirstHeadingBelowLevelOneIsWrittenAsGivenAndVeraPdfRefusesTheFile
    additionally asserts the report.
  • H1, H2, H3, H3, H2 still saves under PDF/UA-1, and veraPDF ua1 passes it.

Activity

  1. added
    bug
    on Nov 29, 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.

    • Iso14289_1_7_4_2_AFirstHeadingBelowLevelOneOrASkippedLevelIsReportedUnderThePdfUa1Claim (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

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions