PDF & Documents100% Free for AllClient-Side PrivateAuto-saved (3 days)

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.

Target size
KB

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

  1. Pick a target size from the presets, or type an exact figure in kilobytes.
  2. Generate. Four PDFs appear, each with a randomised page count between one and four.
  3. Download whichever you need — the filename records the page count and size.
  4. 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?

Yes. They are built with pdf-lib and contain real pages, headings, and body text.

Do these PDFs actually open?

Yes. They are constructed with pdf-lib and contain real page objects, embedded Helvetica text, and vector shapes. Acrobat, Preview, and browser viewers all open them normally.

Why is most of the file padding at large sizes?

Because a few pages of text is only a few kilobytes. Asking for 10MB means roughly 10MB of ignored padding after the %%EOF marker. That is exactly right for testing a size limit, but it is not a realistic stand-in for a genuinely image-heavy 10MB scan.

Can I control the page count?

Not directly — it is randomised between one and four so the samples differ. Generating repeatedly will give you the count you want, or you can split a larger file.

Is the file uploaded anywhere?

No. The PDF is built in your browser with pdf-lib and saved directly to your device.