2017 © Pedro Peláez
 

library pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

image

ncjoes/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  • Thursday, July 20, 2017
  • by ncjoes
  • Repository
  • 2 Watchers
  • 3 Stars
  • 78 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

PDF-Suite - a high level PHP wrapper over PopplerPhp

PDF Suite extracts and converts the contents of PDF files to various formats, including HTML and SVG using Poppler utils

PDF-to-Html PDF-to-Images PDF-to-Text PDF-Splitter PDF-Combiner PDF-to-SVG, (*1)

Why Use PDF-Suite?

Many packages tagged as PDF converters are actually *->PDF converters, i.e from other formats to PDF. PDF Suite, on the other hand, provides a high level of abstraction over the PopplerPhp package, making it more easy to convert your PDF files into any of the formats supported by Poppler utils. These supported formats include:, (*2)

  • HTML
  • JPG, PNG, TIFF
  • PostScript (PS)
  • Encapsulated PostScript (EPS)
  • Scalable Vector Graphic (SVG)
  • Plain Text

You can also use this package to split pdf files, combine pdf files, and detach embedded items from pdf files using PHP., (*3)

How to Install?

You can install this package using any of these 2 methods:, (*4)

  • Install it via Composer (ncjoes/pdf-suite on Packagist);
  • Use the official Git repository (https://github.com/ncjoes/pdf-suite).

Then, require the vendor/autoload.php file to enable the autoloading mechanism provided by Composer. Otherwise, your application won't be able to find the classes of this Symfony component., (*5)

Finally, point the config settings to the location of Poppler utils binaries on your php server. See PopplerPhp installation notes for help with Poppler Utils installation., (*6)

How to Use?

Setup Poppler utils binaries location, (*7)

NcJoes\PdfSuite\Config::setBinDirectory($dir);

Here are some examples., (*8)

getPdfInfo(); //returns an associative array
    $authors = $pdf_info->getAuthors();
    $number_of_pages = $pdf_info->getNumOfPages();
    //...e.t.c.

//PDF to HTML converter
    $htmlConverter = $pdfSuite->getPdfToHtmlConverter();
    
    $htmlConverter->setPageRange(1, 16)->useDefaultSettings();
    $htmlConverter->setOutputSubDir('testSinglePageConverterOption');
    
    // returns a directory instance, a OOP model of a directory/folder containing the output files
    $directory = $htmlConverter->convert($htmlConverter::MODE_SINGLE_PAGE_PER_DOC);
    //other output mode options include
        //$converter::MODE_MULTI_PAGED_SINGLE_DOC
        //and
        //$converter::MODE_COMPLEX_DOCUMENT

//PDF to JPEG converter
    $jpegConverter = $pdfSuite->getPdfToJpegConverter();
    $jpegConverter->setPageRange(15, 33);
    $jpegConverter->convert(); // returns a directory instance

//PDF to PNG converter
    $pngConverter = $pdfSuite->getPdfToPngConverter();
    $pngConverter->setPageRange(15, 33);
    $pngConverter->convert(); // returns a directory instance

//PDF to PostScript converter
    $psConverter = $pdfSuite->getPdfToPsConverter();
    $psConverter->setPageRange(15, 33);
    $psConverter->convert(); // returns a directory instance

//PDF to SVG converter
    $svgConverter = $pdfSuite->getPdfToSvgConverter();
    $svgConverter->setPageRange(15, 33);
    $svgConverter->convert(); // returns a directory instance

//You can also obtain the underlying NcJoes\PopplerPhp\PopplerUtil instance
// and use it to further customize any of the converters
    $svgConverter = $pdfSuite->getPdfToSvgConverter();
    $svgConverterUtil = $svgConverter->util();
    $svgConverterUtil->utilOptions(); //returns an array of all available options for svgConverter
    $svgConverterUtil->setOption('key', 'value');
    //etc
?>

License

The PDF Suite package is open-sourced software licensed under the MIT license., (*9)

Feedback & Contribute

Notify me of any issues, bugs, or improvements. Thanks :+1:, (*10)

The Versions

20/07 2017

dev-master

9999999-dev https://github.com/ncjeos/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chukwuemeka Nwobodo

pdf pdf converter poppler-utils pdf to html converter pdf to svg converter pdf to jpg converter pdf to png converter pdf to postscript converter

20/07 2017

v0.1.4

0.1.4.0 https://github.com/ncjeos/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chukwuemeka Nwobodo

pdf pdf converter poppler-utils pdf to html converter pdf to svg converter pdf to jpg converter pdf to png converter pdf to postscript converter

15/04 2017

v0.1.3

0.1.3.0 https://github.com/ncjeos/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chukwuemeka Nwobodo

pdf pdf converter poppler-utils pdf to html converter pdf to svg converter pdf to jpg converter pdf to png converter pdf to postscript converter

12/11 2016

v0.1.2

0.1.2.0 https://github.com/ncjeos/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chukwuemeka Nwobodo

pdf pdf converter poppler-utils pdf to html converter pdf to svg converter pdf to jpg converter pdf to png converter pdf to postscript converter

24/10 2016

v0.1.1

0.1.1.0 https://github.com/ncjeos/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chukwuemeka Nwobodo

pdf pdf converter poppler-utils pdf to html converter pdf to svg converter pdf to jpg converter pdf to png converter pdf to postscript converter

17/10 2016

v0.1.0

0.1.0.0 https://github.com/ncjeos/pdf-suite

A high level wrapper over Poppler-Php for PDF content extraction and conversion using Poppler utils

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chukwuemeka Nwobodo

pdf pdf converter poppler-utils pdf to html converter pdf to svg converter pdf to jpg converter pdf to png converter pdf to postscript converter