2017 © Pedro Peláez
 

library ghostscript

Ghostscript PDF, a library to handle PDF through ghostscript

image

alchemy/ghostscript

Ghostscript PDF, a library to handle PDF through ghostscript

  • Wednesday, May 2, 2018
  • by bburnichon
  • Repository
  • 10 Watchers
  • 18 Stars
  • 104,121 Installations
  • PHP
  • 3 Dependents
  • 1 Suggesters
  • 21 Forks
  • 3 Open issues
  • 8 Versions
  • 5 % Grown

The README.md

Ghostscript PHP driver

Build Status, (*1)

API usage

To instantiate Ghostscript driver, the easiest way is :, (*2)

$transcoder = Ghostscript\Transcoder::create();

You can customize your driver by passing a Psr\Log\LoggerInterface or configuration options., (*3)

Available options are :, (*4)

  • gs.binaries : the path (or an array of potential paths) to the ghostscript binary.
  • timeout : the timeout for the underlying process.
$transcoder = Ghostscript\Transcoder::create(array(
    'timeout' => 42,
    'gs.binaries' => '/opt/local/gs/bin/gs',
), $logger);

To process a file to PDF format, use the toPDF method :, (*5)

Third and fourth arguments are respectively the first page and the number of page to transcode., (*6)

$transcoder->toPDF('document.pdf', 'first-page.pdf', 1, 1);

To render a file to Image, use the toImage method :, (*7)

$transcoder->toImage('document.pdf', 'output.jpg');

Silex service provider :

A Silex Service Provider is available, all parameters are optionals :, (*8)

$app = new Silex\Application();
$app->register(new Ghostscript\GhostscriptServiceProvider(), array(
    'ghostscript.configuration' => array(
        'gs.binaries' => '/usr/bin/gs',
        'timeout'     => 42,
    ),
    'ghostscript.logger' => $app->share(function () use ($app) {
        return $app['monolog']; // use Monolog service provider
    }),
));

$app['ghostscript.transcoder']->toImage('document.pdf', 'image.jpg');

License

Released under the MIT License, (*9)

The Versions

02/05 2018

dev-SILEX2

dev-SILEX2

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

02/05 2018

4.1.0

4.1.0.0

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

30/11 2016

dev-master

9999999-dev

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

25/06 2013

0.4.0

0.4.0.0

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

24/04 2013

0.3.0

0.3.0.0

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

01/02 2013

0.2.0

0.2.0.0

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

27/11 2012

0.1.x-dev

0.1.9999999.9999999-dev

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript

27/11 2012

0.1.0

0.1.0.0

Ghostscript PDF, a library to handle PDF through ghostscript

  Sources   Download

MIT

The Requires

 

The Development Requires

pdf ghostscript