Extract pages from a PDF
A PDF is a complex, graph-based database, not a flat sequence of images. It features a root Catalog dictionary that links to a Page Tree, which then links to individual page objects.
When you split a PDF document into multiple smaller documents, the tool must carefully traverse this dependency graph.
If you split a 100-page document into 10 separate PDFs, we can't just slice the bytes like a video file.
Each new PDF must receive its own isolated copy of the root Catalog, the Cross-Reference (XRef) tables, and all shared resources (like embedded fonts and color profiles) required by those specific pages. This process of recursively walking the object tree and serializing a perfectly valid sub-graph ensures the split files open flawlessly in Adobe Acrobat.
If a user splits a massive 5,000-page manual into 5,000 separate PDFs, trying to hold all 5,000 generated documents in the browser's RAM at once would instantly cause an Out-Of-Memory (OOM) crash.
To solve this, our background Web Worker generates the split PDFs one at a time and streams the binary output directly into a compressed .zip container. As soon as a split document is streamed into the ZIP, it is aggressively garbage collected from RAM, ensuring memory usage stays flat regardless of the job size.
Why can't you just slice the raw bytes of a PDF file to split it?