Pull images out of a PDF
A PDF does not have a "folder" of images inside it. Instead, images are stored as raw binary streams called XObjects (External Objects) within the PDF's internal database.
When a PDF is created, images are encoded using specific filters to save space. To extract them, this tool reads the XObject dictionary and applies the correct decoding algorithm:
.jpg without any loss of quality..png files to preserve their transparency and exact pixel data.Unlike taking a screenshot of the PDF or using a rasterizing tool, by directly dumping these raw binary streams, this tool achieves zero-loss extraction. The images you get out are byte-for-byte identical to the files that were originally embedded by the creator.
Extracting high-resolution images from a 500-page catalog can quickly consume gigabytes of RAM, which crashes mobile browsers.
To prevent this, we use ArrayBuffer transfers to pass data between the Web Worker and the main thread without duplicating memory. Furthermore, instead of holding all extracted images in memory at once, they are streamed directly into a compressed .zip file chunk by chunk using fflate.
What is the PDF standard name for an embedded image object?