Sample PDF Generator
Create placeholder PDFs at any file size, each with a randomised page count and genuine text content built with pdf-lib. Useful for testing upload caps, PDF viewers, and document pipelines.
Testing anything that accepts PDFs means having PDFs of known sizes to hand, and real documents are rarely the size you need. This builds one to order with pdf-lib: a genuine document with pages, headings, and body text, at exactly the byte size you specify.
How to generate a sample PDF
- Pick a target size from the presets, or type an exact figure in kilobytes.
- Generate. Four PDFs appear, each with a randomised page count between one and four.
- Download whichever you need — the filename records the page count and size.
- Press generate again for a completely different set at the same size.
The Sample PDF Generator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.
When to use this tool
Testing portal upload caps
Government and university portals cap PDFs at 100KB, 2MB, or 5MB. Generating files either side of the line shows whether the check is enforced server-side or only in the browser.
Checking a PDF viewer or parser
A viewer that works on a one-page document may behave differently across page boundaries. Randomised page counts give you both cases without hunting for samples.
Load-testing document storage
Quota handling, virus scanning, and preview generation all scale with file size. A stack of known-size PDFs makes that measurable.
Things worth knowing
- The PDFs are real documents, not renamed junk — they contain a heading, a timestamp, body paragraphs, and a filled rectangle on each page.
- Size is exact: content is generated first, then the file is padded after the %%EOF marker, which every PDF reader ignores.
- Page count is randomised between one and four so the four samples are not identical.
- For a specific page count rather than a random one, generate a larger document and use the Split PDF tool.
Frequently Asked Questions
Do the PDFs actually open?
Do these PDFs actually open?
Why is most of the file padding at large sizes?
Can I control the page count?
Is the file uploaded anywhere?
Related Tools
PDF Merge & Combine
Combine multiple PDF documents into a single organized PDF file entirely client-side in your browser.
Split PDF & Extract Pages
Extract specific pages or page ranges from a PDF into a new document, entirely in your browser.
Sample File Generator
Generate dummy images, PDFs, Word files, CSV, JSON, and video at an exact file size for testing uploads.