prinsfrank/pdfparser
prinsfrank/pdfparser is an MIT-licensed PDF parsing library for PHP 8.1+ with no external dependencies. It is on average 2.6x faster and 5x more memory-efficient than smalot/pdfparser, supports encrypted PDFs, and is actively maintained.
imagick, ghostscript, or pdftotext bridges), so it remains portable across any PHP stack (Laravel, Symfony, Lumen). Unchanged in v3.8.0.GetFont always return a font or throw, rather than returning null and throwing later. Better diagnosability, but it converts a previously-deferred failure into an earlier exception — relevant to anyone extending or decorating the font object layer.composer.lock and pin PHPStan — dev-only, zero consumer impact, but it stabilizes upstream CI and reduces "PHPStan broke our build" churn.PdfParserServiceProvider).Storage::disk() or S3.useInMemoryStream=true for real-time/low-latency needs; false for batch/memory-constrained jobs.GetFont now throws rather than returning null. Low risk for stock consumers, material if we wrote custom decorators or subclasses touching font resolution — audit before the bump. Expect a small increase in exception volume on malformed documents that previously limped through font resolution.PdfParserException gracefully. Unchanged.^3.readonly classes). No new floor announced.memory_limit; raise it or use streaming mode. Column grouping adds per-page state — retest at the top of our size range.Storage facade for PDF upload/retrieval.ParsePdfJob; if column detection proves expensive, route multi-column-capable parsing to a dedicated queue.mime:application/pdf before parsing.pdfparser.columns.enabled (and header/footer suppression) config key so the layout behavior is a deployment decision, not a library default we inherit silently.php artisan pdf:parse /path); PHAR path for environments without Composer.getText() on single-column documents (lowest risk, exercises the syntax and geometry changes), then enable column extraction on a tagged subset, then annotations and markdown links.composer require prinsfrank/pdfparser:^3.8 (no expected code changes).php:8.2 or newer.composer.lock (#584) is repository-side and does not affect consumers' resolution.composer require prinsfrank/pdfparser:^3.8
Add provider/service binding if using DI.use PrinsFrank\PdfParser\PdfParser;
$parser = new PdfParser();
$document = $parser->parseFile(storage_path('app/uploads/file.pdf'));
$text = $document->getText();
$document->getImages() and persist via Storage::put().parseFile($path, password: '...') inside try/catch on PdfParserException.composer.lock and PHPStan pin mean upstream CI stability is better managed — a small positive for our own dependency hygiene story.memory_limit for large PDFs; prefer streaming + segmented processing beyond ~500MB.memory_limit kills the worker, not just the job — ensure workers restart and jobs retry with backoff/caps.composer.lock upstream is neutral-to-positive for supply-chain review.^3.7 remains the lower-risk floor and the upgrade can be deferred to the following window — but do not float the version in the interim.How can I help you explore Laravel packages today?