Repository navigation
veraPDF Test Corpus
Educational reference for understanding the veraPDF corpus structure
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/
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/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-1, PDF/UA-2 (Universal Accessibility)
- Tagged PDFs for screen readers
- Accessibility compliance testing
ISO 32000-1 (PDF 1.7 spec)
- Reference implementation files
ISO 32000-2 (PDF 2.0 spec)
- Modern PDF features
The most commonly used standard (568 PDFs) is organized into 8 categories:
| 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 |
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
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
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
Tests: PDF transparency features
- Transparency groups
- Blend modes
- Alpha channels
Tests: PDF annotation features
- Annotation dictionaries
- Comments, highlights, stamps
Subcategories:
- 6.5.3 Annotation dictionaries
Tests: Interactive PDF features
- JavaScript actions
- Navigation actions (GoTo, URI)
- Trigger events
Subcategories:
- 6.6.1 General
- 6.6.2 Trigger events
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
Tests: PDF form features
- Form fields (text, checkbox, radio)
- Field widgets
- Field values and validation
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)
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
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.
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
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
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
Use small categories to test edge cases:
- 6.4 Transparency - Transparency handling
- 6.5 Annotations - Annotation vs content distinction
- 6.6 Actions - Interactive features
Run against the entire corpus to catch unexpected issues:
- Test 500-1000 random PDFs
- Look for crashes, hangs, corruption
- Validate performance at scale
The corpus is not checked into git due to licensing concerns.
Download via script:
./scripts/download-test-pdfs.shThis downloads to test-pdfs/verapdf-corpus/ (gitignored).
- Testing Strategies - How to use the corpus for testing
- PDF Content Streams - Understanding what 6.2.10 tests
- PDF Font Types and Encodings - Understanding what 6.3 tests
- Progressive Testing Strategy - Phase-by-phase corpus testing plan
- veraPDF Project: https://verapdf.org/
- Corpus Repository: https://github.com/veraPDF/veraPDF-corpus
- PDF Association: https://pdfa.org/
- ISO 19005 (PDF/A): https://www.pdfa.org/resource/iso-19005-pdfa/
- ISO 14289 (PDF/UA): https://www.pdfa.org/resource/iso-14289-pdfua/