Sample PDF Generator
Build a custom sample PDF file in seconds — pick a content type, page count, page size and target file size, then generate. Eleven realistic content types, exact-size padding, AES-256 password protection and full metadata control. Runs entirely in your browser.
Quick Tips for Generating the Perfect Sample PDF
Features
The Test File Nobody Can Find
Search "sample PDF" and most results are one-off uploads from 2014 — a single page, an unpredictable size, a filename like document.pdf and no way to know what's actually inside without opening it. That's a fine starting point when any PDF will do. It falls apart the moment you need something specific: exactly 40 pages to check pagination, exactly 2 MB to sit just under an upload cap, or a document that looks like a real invoice instead of one paragraph of placeholder text. At that point the search stops being about finding a file and starts being about building one.
That's the gap this generator fills. Every setting — content, page count, size, fonts, watermark, password — is decided by you before the file exists, then built to match in your browser. Nothing is fetched from a library of pre-made files, because none of them would fit the specific test you're running.
It comes up most often for QA engineers assembling a regression suite, backend developers confirming an upload endpoint behaves correctly at its stated limits, and frontend developers checking that a PDF.js-based viewer handles unusual page counts or orientations without breaking. It also comes up for people who aren't developers at all — a student who needs a throwaway file for a screenshot, or a product manager who wants something realistic-looking to show a client before the real feature exists.
Matching a Byte, Not a Ballpark
Most "generate a PDF of X size" tools get you close and call it done — a 5 MB request that lands at 5.2 MB, close enough for a demo but useless for confirming an upload limit is enforced at exactly the number your backend claims. This generator does the opposite: it builds your content first, measures the real output, then adds a small standards-compliant padding attachment and re-measures, correcting the padding size on each pass until the file lands exactly on your target — 5,242,880 bytes for a 5 MB request, not somewhere near it.
There's one honest exception. Turn on Password Protection and the math changes: AES-256 encryption pads every internal stream to a 16-byte boundary as part of the standard itself, so an encrypted file sometimes can't land exactly on target. When that happens the generator always rounds up, never down — a 5 MB request becomes 5 MB plus a handful of bytes, never a hair under it, specifically because a file even 1 byte short of a clean boundary displays as a whole unit smaller in a file browser, and that reads as broken in a way that landing slightly over never does. That's a property of AES-CBC, not a shortcut in this tool — and the achieved size is always shown after generation, so you're never guessing which one you got.
Exact sizing matters for more than upload caps. Storage-quota tests need a file that consumes a known number of bytes against a plan limit. Bandwidth-throttling tests want a fixed size so download-time comparisons across network conditions are actually comparable. And regression suites that assert on file size directly — not just "did it download" — need the number to be deterministic every time the test runs, not approximately right.
Eleven Kinds of Filler
Blank Pages and Paragraphs exist for tests where content genuinely doesn't matter — pagination, font rendering, word-wrap accuracy. Tables and Images cover structural rendering: grid layouts, striped rows, placeholder photo blocks with captions. The other seven — Report, Invoice, Certificate, Resume, Contract, Brochure and Mixed Content — exist because a lot of testing needs a document that looks like something a real person would actually upload, not a page of repeated text. Mixed Content cycles through several of these per page when one file needs to exercise more than one rendering path at once.
Every themed type uses ToollyX as the fictional company and a rotating cast of fictional names and clients, so the output reads as a plausible business document without being anyone's real data. Certificates cycle through a pool of recipient names across pages, invoices vary the client and line items, and contracts number their clauses continuously across a multi-page document instead of resetting on each page — small details that matter if the code being tested checks for internal consistency, not just the presence of text.
Two Mornings, Two Different Test Files
A team shipping a document-upload feature needs to prove their 5 MB cap actually rejects files over the line and accepts files under it — not "roughly 5 MB," the exact boundary. Custom size mode gets them a 4.9 MB file and a 5.1 MB file in about a minute combined, tested against both sides of the limit before lunch.
A different team, building a PDF viewer component, needs to know their pagination and thumbnail rendering hold up on something long. Rather than track down a real 300-page report and worry about who owns it, they generate a 300-page Paragraphs file, use it once, and delete it.
Nothing Leaves Your Browser
Every page, every field of metadata you type, and the padding bytes used for exact sizing are all produced on your device using the open-source pdf-lib library running directly in the tab — there's no upload step for a generator to have, since there was never a source file to send anywhere. Password protection runs the same way: AES-256 encryption happens through the browser's built-in Web Crypto API before the download starts, so the password is never transmitted or logged.
One side effect worth knowing: generation is fast enough that it doesn't feel like "generating" at all. A 500-page document downloads in a couple of seconds, since there's no server queue or network round trip standing between clicking the button and getting the file. The page also keeps working after it's loaded even without a connection — useful on a locked-down corporate network where uploading anything, even a test file, has to go through an approval process first.
Where It Falls Short
This tool builds standard, flat documents on purpose — it won't give you real fillable form fields (that's the Sample PDF Form generator) or an image-only, no-text-layer file for OCR testing (that's a separate scanned-document generator). And because it creates files from scratch rather than modifying ones you already have, it's not a substitute for Protect PDF or Compress PDF when the file in question is real.
A few smaller things worth knowing before you generate: forgetting an AES-256 password has no recovery path by design, so only set one you'll actually remember. A long watermark string at a large font size can run past the edge on a small page like A5 — shorten it or size up the page. And Report and Table content draw more per page than Blank or Paragraphs, so very large page counts finish fastest with the simpler content types.