Repository navigation
Commit 133bfc3
format/pdf: exact size, and the padding channel we had written down was wrong
PDF is the third format and the highest fidelity bar in Tier 1. Exact size,
byte determinism, pages and page size as properties, label in the footer and
in the document title.
The interesting part is what measurement overturned.
This project had recorded the padding channel as "a comment block before
%%EOF, no limit". The reasoning behind it was sound as far as it went -
objects and the cross reference table both sit earlier in the file, so a
comment at the end moves no offset. What it missed is how a reader finds that
table: by scanning backwards from the end of the file for startxref, over a
window each reader picks for itself. Xpdf 4.06 reads 1004 bytes of comment
there and fails at 1005. The Windows renderer reads any amount.
That is worse than a hard limit would be. A file that opens for one tester
and not for another is the one outcome a fixture generator must never
produce.
So the channel moved to a comment after the trailer and before startxref. The
tail from startxref to the end stays short whatever the padding size, and
startxref still points at the same offset because the table sits earlier.
Measured at 64 B, 4 KB, 100 KB, 1 MB, 2 MB and 10 MB against three
independent engines - Xpdf, exiftool and the Windows renderer used by the
system viewer. All three read the document and report the right page count.
This is the third claim written from memory that a few minutes of measurement
has disproved, after the 7Z tail and the size units.
Registering PDF also made the property test find two defects immediately. The
comment splitter could leave exactly one byte over, which cannot form a
comment line. And the seed test asked for the declared minimum with the label
on, while the declared minimum is the label free one - the message now says
so and offers --clean.
Fonts are not embedded. Helvetica is one of the fourteen every reader already
has, which keeps a font file and its licence out of this for now.
Fidelity is declared full and confirmed in three engines, not in Adobe.
Acrobat is installed here and stays a manual checklist item.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 5ec5820 commit 133bfc3
5 files changed
Lines changed: 492 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
9 | 38 | | |
10 | 39 | | |
11 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
0 commit comments