PDF Parser Stress-Test Sets

Malformed, boundary, and minimal PDF files for testing parser robustness. Every file is annotated with its expected behavior — should your parser reject it, tolerate it, or partial-parse it?

corrupt-xref.pdf · XREF OFFSETS WRONG · 8 FILES

01WHAT'S IN THE PACK

What's in the Pack

parser-stress-pack.zip contains:

  • corrupt-xref.pdfCross-reference table points to wrong byte offsets. Expected: tolerant parsers recover via linear scan; strict parsers reject.
  • missing-trailer.pdfValid body, no trailer dictionary. Expected: reject (no Root reference).
  • invalid-object-stream.pdfObject stream contains non-PDF tokens. Expected: reject or skip corrupted objects.
  • circular-reference.pdfPage tree contains a self-referencing /Kids entry. Expected: parser must detect cycle and halt, not loop infinitely.
  • font-edge-case.pdfReferences a CIDFont with missing /W array and an embedded Type 3 font with no glyph program. Expected: render with fallback or report missing glyph.
  • encrypted-aes256.pdfAES-256 encrypted, password: password123. Expected: prompt for password, decrypt successfully.
  • oversized-name.pdfA /Name object exceeding 127 characters (spec limit). Expected: strict parsers reject; tolerant parsers truncate.
  • minimal-valid.pdfThe smallest well-formed PDF: 1 page, 1 text object, ~600 bytes. Expected: opens in any conforming reader.
  • expected-behavior.mdPer-file annotation: structure defect, ISO 32000 clause violated, expected strict vs. tolerant behavior.

02THE MINIMAL VALID PDF

The Minimal Valid PDF

minimal-valid.pdf is also available as a standalone download for quick tests:

It conforms to PDF 1.4, contains one page with the text "Hello", and opens in Adobe Acrobat, Chrome, Firefox, Evince, and pdf.js.

Download minimal-valid.pdf (612 bytes)

612 BYTES — SMALLEST WELL-FORMED PDF

03HOW TO USE

How to Use

  1. 01
    Download the ZIP and read expected-behavior.md first.
  2. 02
    Feed each file to your parser.
  3. 03
    Compare actual behavior against the documented expectation (reject / tolerate / partial-parse).
  4. 04
    Flag deviations — especially infinite loops on circular-reference.pdf.

04DOWNLOAD

Download

Download parser-stress-pack.zip Generate a Custom Edge-Case PDF → STATIC CDN · NO GENERATION DELAY · NO ACCOUNT

Yes, deliberately. Each file violates a specific clause of ISO 32000 (PDF spec). The expected-behavior.md documents exactly what is wrong and how a conforming vs. tolerant parser should respond.

Approximately 600 bytes. It is the smallest file that opens correctly in all major PDF readers while remaining a conforming PDF 1.4 document.

Yes. Download the ZIP in your CI pipeline and iterate over the files. The expected-behavior.md is machine-parseable (markdown table). Alternatively, use the API: GET /api/collections/parser.