Skip to content

Page labels close one, and fixed a loss in every verb on the way - #107

Merged
tannevaled merged 1 commit into
mainfrom
labels-close-one
Oct 11, 2026
Merged

tannevaled merged 1 commit into
mainfrom
labels-close-one

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

add-page-labels is claimed, through pdfops labels in go-pdfkit/ops
v0.14.0.

covered       80
not covered   34
parity       70.2% (80/114), every claim verified

⛔ Building it found that every ops verb was dropping the page labels

A /PageLabels tree is keyed by page index, so it cannot be carried the way
the other document keys are — after a select or a reverse every label would
be on the wrong page — so the package dropped it. A document whose front matter
was numbered i, ii, iii came back from a watermark numbered 1, 2, 3.

They are asked for per page and rebuilt now, which is right in both
directions, and a mutation that restores the old behaviour is caught.

Four things the format says that the fiche does not

Each would have been a silent defect if guessed:

a range is contiguous a rule over 1-9,30-40 must be compiled into two runs; odd into one run per page
a tree has no gaps an entry labels until the next one, so "1, 2, then nothing" came back 1, 2, 3, 4 until the stop was written out. The round-trip caught it, not the standard
/St ≥ 1 ISO 32000-1 table 159. BentoPDF's own "set to 0 for zero-based numbering" writes a value the standard forbids; this refuses it
letters ≠ spreadsheet columns 27 is AA and 28 is BB, where a spreadsheet's 28 is AB

Measured 2026-10-11 against BentoPDF 3a5f146 (v2.8.8, 114 tools), pdfops
and ops at v0.14.0, ooxml v0.2.0, opc v0.1.0, odf 3d1deee
(= v0.7.0), convert 45fbb5d, render 3bb5dcf, app 1feda5d, rtf
6bc4897, markdown eafebfd, data 128b6c7.

🤖 Generated with Claude Code

add-page-labels is claimed, through `pdfops labels` in go-pdfkit/ops v0.14.0.

⛔ Building it found that EVERY ops verb was silently dropping the page labels.
A /PageLabels tree is keyed by page INDEX, so it cannot be carried the way the
other document keys are — after a select or a reverse every label would be on
the wrong page — so the package dropped it, and a document whose front matter
was numbered i, ii, iii came back from a WATERMARK numbered 1, 2, 3. They are
asked for per page and rebuilt now.

Four things the format says that the fiche does not, each of which would have
been a silent defect:

  - a page-label range is CONTIGUOUS, so a rule over "1-9,30-40" has to be
    compiled into two runs, and "odd" into one run per page;
  - a page-label tree has NO GAPS: an entry labels until the next one, so
    "1, 2, then nothing" came back 1, 2, 3, 4 until the stop was written out
    explicitly. The round-trip through the file caught it;
  - /St shall be at least 1 (ISO 32000-1 table 159) — so BentoPDF's own "set
    to 0 for zero-based numbering" writes a value the standard FORBIDS, and
    this refuses it instead;
  - the letters are NOT a spreadsheet's columns: 27 is AA and 28 is BB, where
    a spreadsheet's 28 is AB.

Pasted from the tool's own output:

    covered       80
    not covered   34
    parity       70.2% (80/114), every claim verified

Measured 2026-10-11 against BentoPDF 3a5f146 (v2.8.8, 114 tools), pdfops and
ops at v0.14.0, ooxml v0.2.0, opc v0.1.0, odf 3d1deee (= v0.7.0), convert
45fbb5d, render 3bb5dcf, app 1feda5d, rtf 6bc4897, markdown eafebfd,
data 128b6c7.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit cd9c267 into main Oct 11, 2026
9 checks passed
@tannevaled
tannevaled deleted the labels-close-one branch October 11, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant