php-extended/php-pdf2json-object

An implementation of the php-extended/php-pdf2json-interface library

7.0.6 2024-07-31 13:35 UTC

This package is auto-updated.

Last update: 2024-10-01 00:09:19 UTC


README

An implementation of the php-extended/php-pdf2json-interface library.

coverage build status

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).