2017 © Pedro Peláez
 

library pdfxtractor

Convert PDFs to JPEG images like a charm!

image

guillaumepotier/pdfxtractor

Convert PDFs to JPEG images like a charm!

  • Monday, May 28, 2012
  • by guillaumepotier
  • Repository
  • 2 Watchers
  • 17 Stars
  • 1,322 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

PdfXtractor

PdfXtractor is a PHP class that relies on GhostScript. This is a handy wrapper that allows PDF conversion to JPEG files., (*1)

Build Status, (*2)

Installation

The recommended way to install PdfXtractor is through composer., (*3)

Just create a composer.json file for your project:, (*4)

``` json { "require": { "guillaumepotier/PdfXtractor": "*" } }, (*5)


And run these two commands to install it: ``` bash $ wget http://getcomposer.org/composer.phar $ php composer.phar install

Now you can add the autoloader, and you will have access to the library:, (*6)

``` php <?php, (*7)

require 'vendor/autoload.php';, (*8)


If you don't use neither **Composer** nor a _ClassLoader_ in your application, just require the provided autoloader: ``` php <?php require_once 'src/autoload.php';

Be sure to give permissions to the GhostScript binary you'll use:, (*9)

chmod 777 bin/gs-905-osx

You're done!, (*10)

Usage

You'll just need to specify the pdf you want to convert, where you want to dump the .jpg files generated and under which name:, (*11)

``` php <?php, (*12)

$pdfXtractor = new PdfXtractor\PdfXtractor(); $pdfXtractor->load(DIR.'/file.pdf')->set(DIR.'/output', 'extract'); $pdfXtractor->extract();, (*13)


Unit Tests ---------- To run unit tests, set your proper phpunit.xml file by doing:

cp phpunit.xml.dist phpunit.xml vi phpunit.xml, (*14)


Set the `GS_BIN` you'll use in your environement. Save and launch then the following command:

phpunit ```, (*15)

TODO

Need to better rationalize the GhostScript binary used in function of the user OS. Maybe integrate a shell script to build gs properly for the user os, because the 3 gs bin provided here are a little heavy (~100Mb) and still no better than a proper build., (*16)

Credits

Guillaume Potier. @guillaumepotier, (*17)

License

PdfXtractor is released under the MIT License for the PHP Wrapper. Unfortunately, GhostScript is under GPL license. Which makes this whole project under GPL license. See the bundled LICENSE file for more details., (*18)

The Versions

28/05 2012

dev-master

9999999-dev

Convert PDFs to JPEG images like a charm!

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

pdfxtractor pdftojpeg pdftojpg pdfconverter

27/05 2012

1.0.0

1.0.0.0

Convert PDFs to JPEG images like a charm!

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

pdfxtractor pdftojpeg pdftojpg pdfconverter