PDF preservation diagnostics

Why JHOVE reports “No file trailer” when the trailer is still present

In this synthetic PDF, two cross-reference rows are one byte too short while the closing trailer keyword remains intact. JHOVE is right to reject the file, but the reported error points to the trailer instead of the shortened rows.

Jonathan Simone, with AI assistance. Recorded October 27, 2026. JHOVE 1.34.0 / PDF-hul 1.12.8.

How shortened cross-reference rows shift the trailer past JHOVE’s fixed scan offset

Download and reproduce

Cross-reference rows form a PDF’s index of object locations. In these files, JHOVE expects four 20-byte rows. Removing spaces moves the closing trailer keyword earlier, but the calculated scan still starts at byte 289.

Complete rowsJHOVE passes; row rule met
  1. 287n
  2. 288SP
  3. 289LF
  4. 290t
  5. 291r
  6. 292a
  7. 293i
  8. 294l
  9. 295e
  10. 296r

Last two rows: 20 / 20 bytes. Trailer starts at 290. The scan encounters a line feed, then trailer.

One space removedJHOVE passes; row rule broken
  1. 287n
  2. 288LF
  3. 289t
  4. 290r
  5. 291a
  6. 292i
  7. 293l
  8. 294e
  9. 295r
  10. 296LF

Last two rows: 20 / 19 bytes. Trailer starts at 289. The scan still finds trailer, even though a row breaks the rule.

Two spaces removedJHOVE rejects; row rule broken
  1. 287LF
  2. 288t
  3. 289r
  4. 290a
  5. 291i
  6. 292l
  7. 293e
  8. 294r
  9. 295LF
  10. 296<

Last two rows: 19 / 19 bytes. Trailer starts at 288. The scan misses the first letter and reads railer. The trailer has not disappeared.

SP = space. LF = line feed. The underlined letters spell trailer; the boxed column marks the scan start. This is a source-code explanation beside recorded results, not a live validator or an instrumented trace.

Inspect the exact rows and recorded results
Choose a recorded comparison

Complete rows

What the tool reported

Well-Formed and valid

No error message for this file.

What I checked

All four rows are 20 bytes. The trailer begins at byte 290.

Download blank synthetic test PDF (344 bytes)

The last two rows

Object 20000000058 00000 nSP LF20 bytes
Object 30000000115 00000 nSP LF20 bytes

SP = space. LF = line feed. The two-character ending makes each complete row 20 bytes.

One space removed

What the tool reported

Well-Formed and valid

No error message for this file.

What I checked

The last row is 19 bytes. That breaks the row-length rule, but this file still passes.

Download blank synthetic test PDF (343 bytes)

The last two rows

Object 20000000058 00000 nSP LF20 bytes
Object 30000000115 00000 nLF19 bytes

SP = space. LF = line feed. The two-character ending makes each complete row 20 bytes.

Two spaces removed

What the tool reported

Not well-formed

PDF-HUL-71; “No file trailer”

What I checked

The last two rows are 19 bytes. The complete trailer remains at byte 288.

Download blank synthetic test PDF (342 bytes)

The last two rows

Object 20000000058 00000 nLF19 bytes
Object 30000000115 00000 nLF19 bytes

SP = space. LF = line feed. The two-character ending makes each complete row 20 bytes.

Use this in your work

If this appears in your validation queue

PDF-HUL-71 alone does not identify the underlying defect: the genuinely missing-trailer control file produces the exact same message. These test files show two distinct causes for that output rather than a general diagnostic rule.

  1. Preserve the original file

    Run diagnostics on a working copy and retain the original file’s identifier and SHA-256 checksum so your notes stay tied to the exact bytes.

  2. Record the validator version and command

    Save the JHOVE and PDF module versions, command line, configuration and full output. Do not rely on the process exit code alone: every command in this experiment exited 0, including the invalid files.

  3. Inspect the cross-reference table before assigning a cause

    Check the trailer and cross-reference rows on the copy. A matching error message does not mean your file shares this specific defect; record what you inspected and what remains uncertain.

  4. Separate diagnosis from file repair

    Do not pad cross-reference rows or rewrite archival masters based on this example. If you create a derivative copy, keep the original and evaluate the derivative under your preservation policy.

Opening in a reader, passing validation and being suitable for preservation or migration are different claims. This example does not demonstrate a safe repair.

Why does the scan start at byte 289?

The count token leaves the parser offset at 209. parseTrailer seeks to 209 + 4 times 20 = 289. In the control, that is the newline immediately before trailer; with one shortened row, it is the first letter t; with two shortened rows, it is the r and the trailer keyword is missed.

Reported This is a source-derived explanation consistent with the observed outputs. The error’s reported offset, 341, is where the unsuccessful search ends, not the location of the short row.

All six cases

Comparing the six test files and line-ending controls

The three legal cross-reference row endings are space + LF, space + CR, and CR + LF. The control files vary only the final row’s line ending. Each result was recorded twice and checked by a separate AI agent in the same environment. Established

JHOVE 1.34.0, PDF-hul 1.12.8; Synthetic PDF 1.4 files
FileRow lengthsTrailerRecorded result
control sp lf20, 20, 20, 20Present at 290Well-Formed and valid
short row lf20, 20, 20, 19Present at 289Well-Formed and valid
two short rows20, 20, 19, 19Present at 288Not well-formed
PDF-HUL-71
missing trailer20, 20, 20, 20AbsentNot well-formed
PDF-HUL-71
control sp cr20, 20, 20, 20Present at 290Well-Formed and valid
control cr lf20, 20, 20, 20Present at 290Well-Formed and valid

Byte offsets start at zero. Every command exited 0, including the invalid cases. The reproduction script checks the reports, not just the exit code.

Question, answered as of

Why does JHOVE report “No file trailer” for a file whose trailer is present?

Established In these six files, JHOVE 1.34.0 with PDF-hul 1.12.8 reports PDF-HUL-71 when two cross-reference rows are one byte short, even though the trailer is intact; one short row still passes. Read from JHOVE's source, the likely cause is a trailer scan that starts at a fixed offset computed from 20-byte rows, so it begins after the first letter of the keyword.

How sure
  • high that the message occurs for these exact files and versions: twelve recorded runs agree, and anyone can rerun them with the public package
  • moderate why it occurs: the fixed-offset explanation fits all six results, but it comes from reading the source, not from tracing a run
  • none yet how often it happens in real collections: not measured; these are synthetic files
Lines of evidence
  • Six synthetic files, each run twice on one Windows setup and rerun by a separate AI agent in the same environment. Repeats on one setup count as one line. Could be wrong if: a detail of this machine or configuration, not the rows, changes the result
  • A reading of the JHOVE 1.34.0 source that predicts the scan start at byte 289. Could be wrong if: the code path read is not the one that runs
  • The upstream report by awaldlza in JHOVE issue 1081 and Carl Wilson’s clarification. Could be wrong if: it concerns a different file, so it supports the pattern but not these exact offsets
Strongest objection
The cause is inferred from source code, not observed in a running validator. Only one JHOVE version on one operating system was tested.
What would change this answer
An instrumented run showing the scan starting somewhere other than byte 289, a different result on another machine or JHOVE version, or an upstream change to how the error is reported.
Next test
Log where the trailer scan starts during a run. The source reading predicts byte 289 for all three aligned files; another code path would show a different start.
What changed this answer (1)
  1. : The first prediction (one short row triggers the error) was wrong: that file passed. It stays in the comparison; a second short row reproduced the message.

Keep the evidence

Download the six test PDFs and reproduction script

The MIT-licensed package includes six blank synthetic test PDFs, the generator script, configuration, case record and twelve recorded reports. The pages are blank because this experiment tests byte offsets in the cross-reference table rather than page rendering. Java and JHOVE are downloaded separately from their publishers.

For a recorded answer: use the six-case table above and inspect their reports. For an exact rerun: follow the README with Python, Java and the pinned JHOVE files. For your existing JHOVE workflow: use these synthetic PDFs as test inputs and compare versions and reports; a different setup is not an exact reproduction.

python reproduce.py generate generated
python reproduce.py check generated
python reproduce.py run generated --tools tools

Start with the README: Python 3.10+, Java, and the two pinned JHOVE JARs are required. The script generates new files, verifies hashes and compares all six statuses and diagnostic identifiers. It refuses to overwrite an existing output folder.

Inspect the recorded reports, hashes and tool versions

Recorded reports preserve every diagnostic field. Line endings are normalized to LF; only Date and LastModified clock times/time zones are omitted under the site publication policy. The original-capture hashes identify retained private captures, not additional downloadable files.

control-sp-lf.pdf; 344 bytes

SHA-256: 70a1d89401df160ac5b5447fe480ac9aaa27ca41a91097f88dc1287074217ab0

Jhove (Rel. 1.34.0, 2025-07-02)
 Date: 2026-10-27 [clock time omitted]
 RepresentationInformation: fixtures/control-sp-lf.pdf
  ReportingModule: PDF-hul, Rel. 1.12.8 (2025-03-12)
  LastModified: 2026-10-27 [clock time omitted]
  Size: 344
  Format: PDF
  Version: 1.4
  Status: Well-Formed and valid
  SignatureMatches:
   PDF-hul
  MIMEtype: application/pdf
  PDFMetadata: 
   Objects: 4
   FreeObjects: 1
   IncrementalUpdates: 0
   DocumentCatalog: 
    PageLayout: SinglePage
    PageMode: UseNone
   Pages: 
    Page: 
     Sequence: 1

First report; Repeat report

short-row-lf.pdf; 343 bytes

SHA-256: 286ce878682ea3c8af583e31ca866782ae8d1850e8079d0d4027ce73c4f3676a

Jhove (Rel. 1.34.0, 2025-07-02)
 Date: 2026-10-27 [clock time omitted]
 RepresentationInformation: fixtures/short-row-lf.pdf
  ReportingModule: PDF-hul, Rel. 1.12.8 (2025-03-12)
  LastModified: 2026-10-27 [clock time omitted]
  Size: 343
  Format: PDF
  Version: 1.4
  Status: Well-Formed and valid
  SignatureMatches:
   PDF-hul
  MIMEtype: application/pdf
  PDFMetadata: 
   Objects: 4
   FreeObjects: 1
   IncrementalUpdates: 0
   DocumentCatalog: 
    PageLayout: SinglePage
    PageMode: UseNone
   Pages: 
    Page: 
     Sequence: 1

First report; Repeat report

two-short-rows.pdf; 342 bytes

SHA-256: 07836cc1f76f1395ed2a1fa960cfb632ed6f9071281b6f96c20c14716d03f631

Jhove (Rel. 1.34.0, 2025-07-02)
 Date: 2026-10-27 [clock time omitted]
 RepresentationInformation: fixtures/two-short-rows.pdf
  ReportingModule: PDF-hul, Rel. 1.12.8 (2025-03-12)
  LastModified: 2026-10-27 [clock time omitted]
  Size: 342
  Format: PDF
  Status: Not well-formed
  SignatureMatches:
   PDF-hul
  ErrorMessage: No file trailer
   ID: PDF-HUL-71
   InfoLink: https://github.com/openpreserve/jhove/wiki/PDF-hul-Messages#pdf-hul-71
   Offset: 341
  MIMEtype: application/pdf

First report; Repeat report

missing-trailer.pdf; 310 bytes

SHA-256: 49c559b658f0aaa81811edfb2c6363fcdcb298fc41b7ba8f7606c444698f46aa

Jhove (Rel. 1.34.0, 2025-07-02)
 Date: 2026-10-27 [clock time omitted]
 RepresentationInformation: fixtures/missing-trailer.pdf
  ReportingModule: PDF-hul, Rel. 1.12.8 (2025-03-12)
  LastModified: 2026-10-27 [clock time omitted]
  Size: 310
  Format: PDF
  Status: Not well-formed
  SignatureMatches:
   PDF-hul
  ErrorMessage: No file trailer
   ID: PDF-HUL-71
   InfoLink: https://github.com/openpreserve/jhove/wiki/PDF-hul-Messages#pdf-hul-71
   Offset: 309
  MIMEtype: application/pdf

First report; Repeat report

control-sp-cr.pdf; 344 bytes

SHA-256: c068b60273e96f45ef4a14cda5d7fb01c88b580cb64b1a7d4d3efeb52993f526

Jhove (Rel. 1.34.0, 2025-07-02)
 Date: 2026-10-27 [clock time omitted]
 RepresentationInformation: fixtures/control-sp-cr.pdf
  ReportingModule: PDF-hul, Rel. 1.12.8 (2025-03-12)
  LastModified: 2026-10-27 [clock time omitted]
  Size: 344
  Format: PDF
  Version: 1.4
  Status: Well-Formed and valid
  SignatureMatches:
   PDF-hul
  MIMEtype: application/pdf
  PDFMetadata: 
   Objects: 4
   FreeObjects: 1
   IncrementalUpdates: 0
   DocumentCatalog: 
    PageLayout: SinglePage
    PageMode: UseNone
   Pages: 
    Page: 
     Sequence: 1

First report; Repeat report

control-cr-lf.pdf; 344 bytes

SHA-256: 3fdc8ab3199a34cd56f76698a63b32ae64549575d3cab9286118464f1a8cfe45

Jhove (Rel. 1.34.0, 2025-07-02)
 Date: 2026-10-27 [clock time omitted]
 RepresentationInformation: fixtures/control-cr-lf.pdf
  ReportingModule: PDF-hul, Rel. 1.12.8 (2025-03-12)
  LastModified: 2026-10-27 [clock time omitted]
  Size: 344
  Format: PDF
  Version: 1.4
  Status: Well-Formed and valid
  SignatureMatches:
   PDF-hul
  MIMEtype: application/pdf
  PDFMetadata: 
   Objects: 4
   FreeObjects: 1
   IncrementalUpdates: 0
   DocumentCatalog: 
    PageLayout: SinglePage
    PageMode: UseNone
   Pages: 
    Page: 
     Sequence: 1

First report; Repeat report

Tested on Windows with Eclipse Temurin 21.0.9+10. Tool files matched their published SHA-256 checksums.

  • java.zip

    39c5e23f3ce4d420663afba8ffde28034b72e2b3e240943dc2321bc1f912eef9

  • jhove-apps-1.34.0.jar

    35dd738db51befe430ce48e3567f7f70a99ed1f14834fa23962b8e790cc9881b

  • pdf-hul-1.12.8.jar

    c5acf4e2c84aec6575390bcc43d9e015c6237b75eec5f1f354de7102e6e023bb

Generator and replay script; Exact configuration; MIT terms

The configuration references OPF’s HTTPS schema. This recipe is not an offline qualification.

Sources and scope

Upstream issue and related OPF resources

The malformed-row diagnostic was reported by awaldlza and clarified by Carl Wilson. OPF already provides JHOVE, an 88-case handbuilt PDF corpus, an error-message wiki and the By JHOVE! Explain Yourself initiative. My contribution is this controlled six-file comparison and its reusable evidence package, not the discovery of the defect.

Limits and correction history
  • This is a controlled reproduction and explanation of an existing reported diagnostic problem, not a claim of first discovery.
  • A passing report, a file opening in a reader, and suitability for preservation or migration are different claims.
  • No general repair, migration, rendering-equivalence, PDF/A or security-safety claim is established. Do not normalize arbitrary file bytes from this example.
  • Separate AI review and a rerun in the same environment are not outside expert acceptance or independent institutional reproduction.
  • The effect depends on these exact bytes and tool versions. It is not a rule that every short row causes this error.

What changed during this investigation

2026-10-27. The initial hypothesis predicted missing-trailer for one deleted space. Actual execution accepted that file. It is retained in the comparison; a second shortened row reproduces the diagnostic. Preliminary runs also had a configuration-schema warning; the final 12 runs use the corrected configuration with empty stderr.

No original archival files or issue attachments were copied. The PDFs are synthetic blank pages. The comparison does not measure how often this problem occurs in collections.

File details on this page

Format, size and a short SHA-256 identifier, measured when this page was built.