Skip to content

veraPDF Test Corpus

Marc Jones edited this page Dec 24, 2025 · 1 revision

veraPDF Test Corpus

Educational reference for understanding the veraPDF corpus structure

What is veraPDF?

veraPDF is an open-source PDF validator from the PDF Association:

  • Industry-standard tool for PDF/A compliance checking
  • Provides official conformance test suite
  • Used for validating PDF processors and validators

Website: https://verapdf.org/

What is the Corpus?

The veraPDF corpus is the official test PDF collection from the PDF Association:

  • 2,694 total PDFs covering multiple PDF standards
  • Covers PDF/A (archival), PDF/UA (accessibility), and ISO 32000 (PDF spec)
  • Includes both valid (*pass*.pdf) and intentionally broken (*fail*.pdf) PDFs
  • Used for validating PDF processors and validators

GitHub: https://github.com/veraPDF/veraPDF-corpus

PDF Standards Covered

PDF/A Standards (Archival PDFs)

PDF/A-1a, PDF/A-1b (PDF 1.4 based)

  • Most restrictive archival standard
  • PDF/A-1b = basic archival (most common)
  • PDF/A-1a = accessible archival (tagged)

PDF/A-2a, 2b, 2u (PDF 1.7 based)

  • Modern archival PDFs
  • Support for JPEG2000, layers, transparency

PDF/A-3b (PDF 1.7 based)

  • Allows embedded files
  • Used for invoicing, e-records

PDF/A-4, 4e, 4f (PDF 2.0 based)

  • Latest archival standard
  • Advanced PDF 2.0 features

PDF/UA Standards (Accessible PDFs)

PDF/UA-1, PDF/UA-2 (Universal Accessibility)

  • Tagged PDFs for screen readers
  • Accessibility compliance testing

ISO Standards

ISO 32000-1 (PDF 1.7 spec)

  • Reference implementation files

ISO 32000-2 (PDF 2.0 spec)

  • Modern PDF features

PDF/A-1b Category Structure

The most commonly used standard (568 PDFs) is organized into 8 categories:

Category Distribution

Category PDFs % of Total Purpose
6.7 Metadata 414 72.9% XMP metadata, document info
6.1 File structure 68 12.0% Headers, trailers, xref tables
6.2 Graphics 58 10.2% Content streams, color, rendering
6.3 Fonts 15 2.6% Font embedding, metrics
6.9 Interactive Forms 4 0.7% Form fields, widgets
6.4 Transparency 4 0.7% Transparency groups, blend modes
6.6 Actions 3 0.5% JavaScript, navigation actions
6.5 Annotations 2 0.4% Comments, highlights, stamps

Category 6.1: File Structure

Tests: PDF file structure integrity

  • File headers and trailers
  • Cross-reference tables
  • Document information dictionaries
  • String objects and indirect objects
  • Filters and implementation limits

Subcategories:

  • 6.1.2 File header
  • 6.1.3 File trailer
  • 6.1.4 Cross reference table
  • 6.1.5 Document information dictionary
  • 6.1.6 String objects
  • 6.1.8 Indirect objects
  • 6.1.10 Filters
  • 6.1.12 Implementation limits

Category 6.2: Graphics

Tests: Graphics rendering and content streams

  • Content stream syntax
  • Color spaces (ICC, DeviceN, Separation)
  • Images and image compression
  • Form XObjects
  • Graphics state and rendering intents

Subcategories:

  • 6.2.2 Output intent
  • 6.2.3.2 ICCBased colour spaces
  • 6.2.3.3 Uncalibrated color space
  • 6.2.3.4 Separation and DeviceN colour spaces
  • 6.2.4 Images
  • 6.2.5 Form XObjects
  • 6.2.8 Extended graphics state
  • 6.2.9 Rendering intents
  • 6.2.10 Content streams ← Critical for redaction

Category 6.3: Fonts

Tests: Font embedding and rendering

  • Font dictionaries
  • CID fonts (complex fonts)
  • Font subsets
  • Font metrics and character encoding

Subcategories:

  • 6.3.3.1 General
  • 6.3.3.2 CIDFonts
  • 6.3.5 Font subsets
  • 6.3.6 Font metrics

Category 6.4: Transparency

Tests: PDF transparency features

  • Transparency groups
  • Blend modes
  • Alpha channels

Category 6.5: Annotations

Tests: PDF annotation features

  • Annotation dictionaries
  • Comments, highlights, stamps

Subcategories:

  • 6.5.3 Annotation dictionaries

Category 6.6: Actions

Tests: Interactive PDF features

  • JavaScript actions
  • Navigation actions (GoTo, URI)
  • Trigger events

Subcategories:

  • 6.6.1 General
  • 6.6.2 Trigger events

Category 6.7: Metadata

Tests: PDF metadata handling

  • XMP metadata
  • Document information dictionaries
  • Extension schemas
  • Version and conformance identification

Subcategories:

  • 6.7.2 Properties
  • 6.7.3 Document information dictionary
  • 6.7.8 Extension schemas
  • 6.7.9 Validation
  • 6.7.11 Version and conformance level identification

Category 6.9: Interactive Forms

Tests: PDF form features

  • Form fields (text, checkbox, radio)
  • Field widgets
  • Field values and validation

Test File Naming Convention

veraPDF uses this pattern:

{section}-{type}{number}-{pass/fail}-{variant}.pdf

Examples:

  • veraPDF test suite 6-1-2-t01-pass-a.pdf - Test for section 6.1.2, test 01, should pass, variant a
  • veraPDF test suite 6-1-2-t01-fail-b.pdf - Test for section 6.1.2, test 01, should fail, variant b

pass = Valid, conformant PDF (use these for testing) fail = Intentionally broken, non-conformant PDF (skip for basic testing)

Important Characteristics

Test Specimens, Not Real Documents

veraPDF PDFs are minimal test cases, not real-world documents:

❌ Not suitable for:

  • Basic content testing (many have no text)
  • Real-world use case validation
  • User experience testing

✅ Suitable for:

  • Feature validation (does it handle X?)
  • Edge case testing
  • Structural integrity testing
  • Standards compliance validation

Many Have No Extractable Text

Example: A "6.1.2 File header" test PDF validates the PDF header is correct—it may contain only 1 word or no text at all.

For text redaction testing, these PDFs are not ideal for basic validation.

Intentional Failures

Files with -fail- in the name are intentionally broken:

  • Test that validators correctly reject them
  • Should not be used for feature testing
  • Skip these when testing your own code

Using the Corpus for Testing

For Structural Validation

Use categories 6.1 and 6.7 to ensure your code doesn't corrupt PDF structure:

  • Test file I/O doesn't break headers/trailers
  • Test metadata handling is safe
  • Validate cross-references remain intact

For Feature Testing

Use specific categories to test specific features:

  • 6.2 Graphics (especially 6.2.10) - Content stream parsing
  • 6.3 Fonts - Font handling
  • 6.9 Interactive Forms - Form field processing

For Edge Case Testing

Use small categories to test edge cases:

  • 6.4 Transparency - Transparency handling
  • 6.5 Annotations - Annotation vs content distinction
  • 6.6 Actions - Interactive features

For Stress Testing

Run against the entire corpus to catch unexpected issues:

  • Test 500-1000 random PDFs
  • Look for crashes, hangs, corruption
  • Validate performance at scale

Downloading the Corpus

The corpus is not checked into git due to licensing concerns.

Download via script:

./scripts/download-test-pdfs.sh

This downloads to test-pdfs/verapdf-corpus/ (gitignored).

Related Pages

External Resources

Clone this wiki locally