2017 © Pedro Peláez
 

library php-xpdf

XPDF PHP, an Object Oriented library to manipulate XPDF

image

php-xpdf/php-xpdf

XPDF PHP, an Object Oriented library to manipulate XPDF

  • Monday, April 16, 2018
  • by romain
  • Repository
  • 11 Watchers
  • 31 Stars
  • 75,920 Installations
  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 17 Forks
  • 8 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

PHP-XPDF

Build Status, (*1)

PHP-XPDF is an object oriented wrapper for XPDF. For the moment, only PdfTotext wrapper is available., (*2)

Installation

It is recommended to install PHP-XPDF through Composer :, (*3)

{
    "require": {
        "php-xpdf/php-xpdf": "~0.2.0"
    }
}

Dependencies :

In order to use PHP-XPDF, you need to install XPDF. Depending of your configuration, please follow the instructions at on the XPDF website., (*4)

Documentation

Driver Initialization

The easiest way to instantiate the driver is to call the `create method., (*5)

$pdfToText = XPDF\PdfToText::create();

You can optionaly pass a configuration and a logger (any Psr\Logger\LoggerInterface)., (*6)

$pdfToText = XPDF\PdfToText::create(array(
    'pdftotext.binaries' => '/opt/local/xpdf/bin/pdftotext',
    'pdftotext.timeout' => 30, // timeout for the underlying process
), $logger);

Extract text

To extract text from PDF, use the getText method., (*7)

$text = $pdtTotext->getText('document.pdf');

You can optionally extract from a page to another page., (*8)

$text = $pdtTotext->getText('document.pdf', $from = 1, $to = 4);

You can also predefined how much pages would be extracted on any call., (*9)

$pdtTotext->setpageQuantity(2);
$pdtTotext->getText('document.pdf'); // extracts page 1 and 2

Use with Silex

A Silex service provider is available, (*10)

$app = new Silex\Application();
$app->register(new XPDF\XPDFServiceProvider());

$app['xpdf.pdftotext']->getText('document.pdf');

Options can be passed to customize the provider., (*11)

$app->register(new XPDF\XPDFServiceProvider(), array(
    'xpdf.configuration' => array(
        'pdftotext.timeout'  => 30,
        'pdftotext.binaries' => '/opt/local/xpdf/bin/pdftotext',
    ),
    'xpdf.logger' => $logger,
));

License

This project is licensed under the MIT license., (*12)

The Versions

16/04 2018

dev-SILEX2

dev-SILEX2

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

12/04 2018

4.1.0

4.1.0.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

30/11 2016

dev-master

9999999-dev

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

04/07 2016

0.2.3

0.2.3.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

10/12 2015

0.2.2

0.2.2.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

03/07 2013

0.2.1

0.2.1.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

03/07 2013

0.2.0

0.2.0.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

31/01 2013

0.1.1

0.1.1.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf

01/06 2012

0.1.0

0.1.0.0

XPDF PHP, an Object Oriented library to manipulate XPDF

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf xpdf