Free PDF test files and sample generator

Fixed-layout documents that render identically across devices. Ideal for reports, invoices and printable test artifacts.

Generate a .pdf file →

What is a .pdf file?

PDF: Portable Document Format. PDF fixes the layout of a document so it renders identically everywhere, which is why invoices, reports and statements use it. It is a structured binary format with an object graph and a cross-reference table, so a PDF can be superficially readable yet fail validation.

Why generate a test PDF file?

What you can put inside a .pdf file

You get 8 content options for PDF, so the file holds something meaningful rather than random padding: Paragraph text, Table, Numeric / figures, Multi-page, Image, Bar chart, Pie chart, Password protected (test1234). Pick several and they are merged into one file, with a section, sheet, slide or folder for each.

How a .pdf file is identified

Every .pdf file begins with 25 50 44 46, "%PDF", followed by the version. That is what a validator inspecting content rather than the file name looks for.

Negative testing with broken PDF files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.

Sample PDF content

%PDF-1.7
1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj
...

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Open in any PDF viewer or browser, or inspect with `pdfinfo` / `qpdf --check file.pdf`. The "Password protected" content option encrypts the document with the standard security handler, and the password is test1234, published deliberately, since a fixture nobody can open is useless. It uses 40-bit RC4 (revision 2) because that is the variant every reader still opens; it is long obsolete as security, which is irrelevant for generated filler but would matter if anyone mistook it for protection. Useful detail for testing: the page text is genuinely unreadable until decrypted, so a text extractor that silently returns nothing is a bug worth catching.

Media type application/pdf · extension .pdf · category Doc & TXT

Generate a .pdf file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about PDF files

What identifies a .pdf file?

A .pdf file begins with the bytes 25 50 44 46, "%PDF", followed by the version. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

What can go inside the PDF file?

There are 8 content options for .pdf: Paragraph text, Table, Numeric / figures, Multi-page, Image, Bar chart, Pie chart, Password protected (test1234). Choose more than one and they are combined into a single file, a section, sheet, slide or folder per option, rather than downloaded separately.

Can I download several broken PDF files at once?

Yes, select more than one File Condition and you get one ZIP containing a .pdf per condition, each named after its condition.

Can the PDF file use UTF-16 or a byte-order mark?

No, and deliberately. A .pdf file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.

Can I password-protect the PDF file?

Yes, choose the password-protected content option. The password is the published test value shown on the option itself, because a fixture nobody can open is useless. The file is genuinely encrypted, so a reader that supports encryption will ask for the password.

How do I open or verify the PDF file?

Open in any PDF viewer or browser, or inspect with pdfinfo / qpdf --check file.pdf. The "Password protected" content option encrypts the document with the standard security handler, and the password is test1234, published deliberately, since a fixture nobody can open is useless. It uses 40-bit RC4 (revision 2) because that is the variant every reader still opens; it is long obsolete as security, which is irrelevant for generated filler but would matter if anyone mistook it for protection. Useful detail for testing: the page text is genuinely unreadable until decrypted, so a text extractor that silently returns nothing is a bug worth catching.

Related Doc & TXT formats

DOCX · DOCM · TXT · DOC · MD · HTML · RTF · ODT

Browse all file formats →