php-extended / php-pdf2json-object
An implementation of the php-extended/php-pdf2json-interface library
7.0.7
2024-12-08 16:13 UTC
Requires
Requires (Dev)
README
An implementation of the php-extended/php-pdf2json-interface library.
This library was made to get text positions accurate while there are positional calculus errors or no implementations from the smalot/pdfparser library.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-pdf2json-object ^7
/!\
This library REQUIRES the installation of the pdf2json library as native library. More instructions on their github page.
This library does not support OSes others than linux for the moment.
Basic Usage
This library can be used the following way :
use PhpExtended\Pdf2json\Pdf2jsonExtractor;
$extractor = new Pdf2jsonExtractor();
$document = $extractor->extractFromPdfFile('<path/to/pdf/document.pdf>');
foreach($document->text as $text)
{
/** @var $text \PhpExtended\Pdf2json\Pdf2jsonText */
}
License
MIT (See license file).