PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.
PHP
2,731
362 commits
updated Oct 12, 2026
The smalot/pdfparser is a standalone PHP package that provides various tools to extract data from PDF files.
This library is under limited maintenance. It is still kept compatible with supported PHP versions, and community contributions may be accepted. However, there is currently no active feature development and no guarantee that pull requests will be reviewed or merged in a timely manner. If you plan to contribute anything beyond a small, well-scoped fix, please read CONTRIBUTING.md first.
Currently, secured documents and extracting form data are not supported.
This library is under the LGPLv3 license.
This library requires PHP 7.1+ since v1. You can install it via Composer:
composer require smalot/pdfparser
In case you can't use Composer, you can include alt_autoload.php-dist. It will include all required files automatically.
<?php
// Parse PDF file and build necessary objects.
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile('/path/to/document.pdf');
$text = $pdf->getText();
echo $text;
Further usage information can be found here.
Documentation can be found in the doc folder.
410 followers · starred May 2025
6,927 followers · starred Mar 2019
452 followers · starred Mar 2026
327 followers · starred Jun 2019
PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.
PHP
2,731
362 commits
updated Oct 12, 2026
The smalot/pdfparser is a standalone PHP package that provides various tools to extract data from PDF files.
This library is under limited maintenance. It is still kept compatible with supported PHP versions, and community contributions may be accepted. However, there is currently no active feature development and no guarantee that pull requests will be reviewed or merged in a timely manner. If you plan to contribute anything beyond a small, well-scoped fix, please read CONTRIBUTING.md first.
Currently, secured documents and extracting form data are not supported.
This library is under the LGPLv3 license.
This library requires PHP 7.1+ since v1. You can install it via Composer:
composer require smalot/pdfparser
In case you can't use Composer, you can include alt_autoload.php-dist. It will include all required files automatically.
<?php
// Parse PDF file and build necessary objects.
$parser = new \Smalot\PdfParser\Parser();
$pdf = $parser->parseFile('/path/to/document.pdf');
$text = $pdf->getText();
echo $text;
Further usage information can be found here.
Documentation can be found in the doc folder.
410 followers · starred May 2025
6,927 followers · starred Mar 2019
452 followers · starred Mar 2026
327 followers · starred Jun 2019