2017 © Pedro PelĂĄez
 

library ghostscript

Bugfixed version of Meyfarth/Ghostscript-PHP script

image

alanmastro/ghostscript

Bugfixed version of Meyfarth/Ghostscript-PHP script

  • Thursday, December 18, 2014
  • by marco.bicchi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 21 Forks
  • 1 Open issues
  • 8 Versions
  • 2 % 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');

To specify the output resolution and format :, (*8)

# 400 is a good quality for jpeg. Default is 200. Default format is 'png16m'
$transcoder->toImage('document.pdf', 'output.jpg', 400, 'jpeg');

Silex service provider :

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

$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 () {
        return $app['monolog']; // use Monolog service provider
    }),
));

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

License

Released under the MIT License, (*10)

The Versions

18/12 2014

dev-master

9999999-dev

Bugfixed version of Meyfarth/Ghostscript-PHP script

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sébastien GARCIA

pdf ghostscript

18/12 2014

0.4.2

0.4.2.0

Bugfixed version of Meyfarth/Ghostscript-PHP script

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sébastien GARCIA

pdf ghostscript

25/09 2014

0.4.1

0.4.1.0

Forked and enhanced version of alchemy/ghostscript script

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sébastien GARCIA

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