Skip to content

📄 PDF files

Test PDF files in a range of sizes

✅ Free forever 🚫 No signup ⚡ Instant download
100 KB PDF

102,400 bytes

application/pdf

100 MB PDF

104,857,600 bytes

application/pdf

10 KB PDF

10,240 bytes

application/pdf

10 MB PDF

10,485,760 bytes

application/pdf

1 MB PDF

1,048,576 bytes

application/pdf

25 MB PDF

26,214,400 bytes

application/pdf

500 KB PDF

512,000 bytes

application/pdf

50 MB PDF

52,428,800 bytes

application/pdf

5 MB PDF

5,242,880 bytes

application/pdf

About PDF files

Test PDFs from 10 KB to 100 MB are available free. Use them for upload size-limit testing, exercising PDF libraries, checking mail attachment caps, and load-testing document generation.

A PDF keeps its cross-reference table (xref) at the end of the file, so a transfer cut short renders the whole document unreadable. That makes PDF a good subject for truncation-detection tests.

Typical uses

Related reference and articles

📖 Where people get stuck

PDFs sized to the byte, from 10 KB to 100 MB, for checking upload limits and exercising PDF libraries. They are generated for testing and carry none of the embedded fonts, form fields or annotations a real document would. Use a genuine file when those are what you need to try.

Case What happens What to do
gzip does not make it smaller The streams inside a PDF are already Flate-compressed. Compressing again on the wire saves a few percent at best and costs CPU. Keep application/pdf out of nginx gzip_types — it is not there by default. To cut bandwidth, reduce pages or image resolution instead.
A small PDF exhausts memory Memory follows the decoded content, not the file size. A 1 MB PDF holding a 10,000 by 10,000 pixel image needs hundreds of megabytes to render. Cap page count and resolution as well as size. With Ghostscript or pdftoppm, set -r (dpi) explicitly and work a page at a time so memory is released.
A non-PDF passes as a PDF Both Content-Type: application/pdf and a .pdf extension are claims made by the sender. Neither is a check. Check that the first four bytes are 25 50 44 46 (%PDF). Checking for a trailing %%EOF at the same time also catches truncation.

Passing on size and format leaves encrypted PDFs, PDFs with embedded JavaScript and PDFs referencing external resources to be handled separately. For viewing, leave it to a sandboxed viewer; when opening one server-side, disable JavaScript execution.