Corrupted PDF file for testing (truncated)
A damaged PDF: the first 60% of a valid 10-page document, cut short as an interrupted upload would cut it. The %PDF header is intact; the end of the file is missing.
Download
sample-pdf-corrupted.pdf
7.53 KB7,713 bytes
Download PDF sampleDirect download. No sign-up and no waiting.
- Type
- application/pdf
- SHA-256
9318aa1b804e2eae76b296a21231fd178cce681bcd4b4a28997df4251fbc264a- Direct URL
https://sampletestfiles.com/downloads/samples/sample-pdf-corrupted.pdf
This file is invalid on purpose. The file ends part-way through. Its cross-reference table, trailer and %%EOF marker are missing, along with the objects for the last pages.
Why test with this file
Tests error handling. A check of the first bytes or the extension passes this file, so it reaches your PDF library, which must then fail cleanly or repair what it can.
| Damage | Truncated to 60% of its length |
|---|---|
| Header (%PDF-1.4) | Present |
| End-of-file marker (%%EOF) | Missing |
| Cross-reference table | Missing |
| Poppler and pypdf | Reject the file |
| qpdf and other repairing readers | Rebuild the table and recover 6 of the 10 pages |
What to check
After your application has processed sample-pdf-corrupted.pdf, confirm that:
- The file is rejected or flagged as damaged; it is not stored as a healthy document.
- If your library repairs the file, it finds 6 pages, not 10. Decide whether a partial document is acceptable, and tell the user either way.
- The failure is a handled error with a useful message, not a crash, a timeout or an empty preview.
First bytes of the file
The first 64 bytes of sample-pdf-corrupted.pdf as a hex dump: offset, bytes, then the same bytes as text. The PDF signature is 25 50 44 46 2D.
00000000 25 50 44 46 2d 31 2e 34 0a 25 e2 e3 cf d3 0a 31 |%PDF-1.4.%.....1|
00000010 20 30 20 6f 62 6a 0a 3c 3c 20 2f 54 79 70 65 20 | 0 obj.<< /Type |
00000020 2f 43 61 74 61 6c 6f 67 20 2f 50 61 67 65 73 20 |/Catalog /Pages |
00000030 32 20 30 20 52 20 3e 3e 0a 65 6e 64 6f 62 6a 0a |2 0 R >>.endobj.|Preview
No preview is offered, because this file is damaged on purpose. Download it and give it to the software you are testing.
Technical details
| File name | sample-pdf-corrupted.pdf |
|---|---|
| Format | PDF (Portable Document Format) |
| Extension | |
| MIME type | application/pdf |
| Size | 7,713 bytes (7.53 KB) |
| Kind | Binary |
| Signature | 25 50 44 46 2D |
| SHA-256 | 9318aa1b804e2eae76b296a21231fd178cce681bcd4b4a28997df4251fbc264a |
| Created | 2026-10-10 |
| Validation | Deliberately invalid. Independent parsers were confirmed to reject or flag the file when it was generated |
| Preview | Not offered for deliberately damaged files |
| Source | Generated for this site; not copied from elsewhere |
| Licence | Free to use, modify and redistribute (terms) |
| Category | Documents |
Damaged on purpose, and otherwise harmless: the file holds the same generated content as the valid samples. As with any download, scan the file with your own security tools before opening it. How files are made and checked
Download from the command line and verify
Fetch the file with curl, then compare its checksum with the SHA-256 value above.
curl -o sample-pdf-corrupted.pdf 'https://sampletestfiles.com/downloads/samples/sample-pdf-corrupted.pdf'
sha256sum sample-pdf-corrupted.pdf # Linux
shasum -a 256 sample-pdf-corrupted.pdf # macOSOn Windows, run Get-FileHash sample-pdf-corrupted.pdf -Algorithm SHA256 in PowerShell. A matching value proves that the download is complete and unaltered.
About PDF
Fixed-layout documents that look the same on every device. The most common format for upload forms that accept documents.
Where it fits
- File upload testing
Test an upload form or endpoint with files of every size and type it should accept, and several it should refuse.
- File parser testing
Well-formed files and deliberate edge cases for testing code that reads CSV, JSON, XML, PDF and more.
- QA testing
A ready-made set of ordinary and awkward files for exploratory testing and test plans.