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 sample

Direct 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.

DamageTruncated to 60% of its length
Header (%PDF-1.4)Present
End-of-file marker (%%EOF)Missing
Cross-reference tableMissing
Poppler and pypdfReject the file
qpdf and other repairing readersRebuild the table and recover 6 of the 10 pages

What to check

After your application has processed sample-pdf-corrupted.pdf, confirm that:

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 namesample-pdf-corrupted.pdf
FormatPDF (Portable Document Format)
Extension.pdf
MIME typeapplication/pdf
Size7,713 bytes (7.53 KB)
KindBinary
Signature25 50 44 46 2D
SHA-2569318aa1b804e2eae76b296a21231fd178cce681bcd4b4a28997df4251fbc264a
Created2026-10-10
ValidationDeliberately invalid. Independent parsers were confirmed to reject or flag the file when it was generated
PreviewNot offered for deliberately damaged files
SourceGenerated for this site; not copied from elsewhere
LicenceFree to use, modify and redistribute (terms)
CategoryDocuments

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 # macOS

On 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.

PDF format reference

Where it fits

Related files

All curated sample files