1tomany/pdf-pack
A PHP library for rasterizing PDF pages and extracting text via Poppler, with metadata reading, JPEG/PNG output, and a flexible client interface. Requires pdfinfo, pdftoppm, and pdftotext.
pdf-pack gives us page-count/metadata, per-page text extraction, and JPEG/PNG rasterization behind one small API, so the "buy" side of the decision is a Composer install plus a Poppler install rather than a six-week parsing project. It directly unblocks LLM/RAG ingestion work without committing us to a vendor contract.\Generator output maps cleanly onto queued jobs and chunked page ranges, which supports a roadmap item like "large PDFs don't time out or OOM the worker" without new infrastructure.Adopt when:
pdftotext output is acceptable, and you may also need page images for visual checks or multimodal models.symfony/process transitively — the dependency footprint is genuinely one package plus three CLI binaries.poppler-utils; brew install poppler locally).Look elsewhere when:
For executives: "We can start extracting text and page images from PDFs for our AI features in days, not months, using an MIT-licensed PHP library with one dependency. It's the ingestion layer under document Q&A and summarization — the part that isn't differentiated for us, so buying it as open source is the right call. Cost is engineering time plus a standard Linux package in our container image; no license fees, no vendor lock-in, and the code is small enough that we could fork it if the maintainer walks away. The honest caveats: it's a young project with one maintainer and almost no community, and it does not handle scanned documents — those need an OCR step we'd add later. My recommendation is to adopt it behind our own internal interface, which keeps the switching cost to a day if we ever need to replace it."
For engineering: "pdf-pack wraps pdfinfo, pdftoppm, and pdftotext through Symfony Process. Three capabilities: page count/metadata, per-page text extraction, per-page rasterization to JPEG or PNG. Results stream per page via \Generator, so we can hand pages straight to a job or an LLM chunker without holding the whole document in memory. Two integration paths — instantiate PopplerClient directly for prototypes, or build a container of ClientInterface via ClientFactory for anything we intend to test. As of v0.9.0 the Symfony bundle lives in this repo, which gives us a first-party reference for service registration and configuration to port into a Laravel provider; there's no reported API change, so it's a packaging move, not a rewrite. Three things we must handle ourselves: fail fast at boot if the Poppler binaries are missing rather than at first request; pin Poppler in the Docker base image and CI; and process in bounded page ranges per job with a process timeout, since the CLI tools aren't something we should assume are concurrency-safe. Wrap it in our own PdfExtractor contract so tests mock our interface instead of shelling out, and so the underlying library stays swappable."
How can I help you explore Laravel packages today?