PDF internals research
How PDF Structural Overhead Hides Inside Your File
The padded PDF fixture isolates one structural change: forty additional small metadata objects are added while the compressed page-content stream remains 250 bytes. Comparing that file with its unpadded twin measures how much those added objects and the associated PDF structure change this specific file, without treating the result as a typical metadata cost.
What this guide helps you decide
Two PDFs render identically and hold the same content, but one is seven times larger. Where did the extra size go?
This research measures how non-content objects contribute to PDF size using an intentionally padded corpus file. It does not describe a specific application's metadata behaviour and does not recommend deleting structural objects.
Try it on the anchor product: BeanNest Tools /pdf/.
The controlled pair keeps the content stream unchanged
text-40-flate.pdf and text-40-flate-padding.pdf both contain a 250-byte Flate content stream with the same 18.328x inflation sample. The padded fixture differs by the forty additional generated metadata objects.
The measured file growth is 5109 bytes
The unpadded compressed file is 821 bytes and the padded file is 5930 bytes, so the controlled difference is 5109 bytes. That number belongs to this generated pair and includes every byte added by the extra objects and the surrounding file structure.
Object count rises from five to forty-five
The analyzer reports 5 objects for the unpadded fixture and 45 for the padded fixture. At the same time, stream share falls from 30.5 percent to 4.2 percent because the 250-byte content stream is unchanged while the total file grows.
The per-object average is corpus-specific
Dividing the 5109-byte difference by forty gives about 128 bytes per added object in this fixture. That average includes object syntax and the file's larger indexing structure; it is not a floor, a typical PDF metadata size, or a prediction for an XML packet or another writer.
The experiment shows that structure can dominate a small file
In this controlled pair, the added structural bytes are much larger than the page-content stream. That is enough to demonstrate the mechanism the guide needs: two files with the same compressed page content can have very different totals because their object graphs differ.
The corpus does not establish a scaling law
Only one padding count is measured here, so the evidence cannot show whether overhead scales linearly, worse than linearly, or differently across other object counts and PDF writers. Establishing a scaling relationship would require additional fixtures at multiple padding levels.
Structural cost is not evidence that metadata should be removed
The fixture uses deliberately disposable padding to isolate byte cost. Real document information, accessibility structure, fonts, and other objects can serve functional purposes. This measurement supports a size explanation, not a recommendation to strip structural objects from arbitrary PDFs.
First-party evidence and provenance
How we checked this
We generated four single-page PDFs with this repository's own writer, then parsed each file's raw byte structure with this repository's own analyzer. Both tools are dependency-free and deterministic, so the same commands reproduce the same numbers on any machine. For this guide we compared the padded corpus file against its unpadded twin, which are identical except for forty additional metadata objects, so the size difference isolates structural overhead from page content.
- Method
- We generated four single-page PDFs with this repository's own writer, then parsed each file's raw byte structure with this repository's own analyzer. Both tools are dependency-free and deterministic, so the same commands reproduce the same numbers on any machine.
- Environment
- Node.js on a desktop workstation. No PDF library, no network access, and no third-party file was used. The corpus is produced from text this repository owns.
- Captured
- Reviewed by
- BeanNest Studio
Repository evidence artifacts:
tools/research-evidence/pdf/analysis-2026-09-20.jsontools/research-evidence/pdf/README.md