PHPackages                             alchemy/ghostscript - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. alchemy/ghostscript

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

alchemy/ghostscript
===================

Ghostscript PDF, a library to handle PDF through ghostscript

4.1.0(8y ago)30316.5k↓26.3%23[3 issues](https://github.com/alchemy-fr/Ghostscript-PHP/issues)[2 PRs](https://github.com/alchemy-fr/Ghostscript-PHP/pulls)3MITPHPPHP ~7.0

Since Nov 27Pushed 3y ago8 watchersCompare

[ Source](https://github.com/alchemy-fr/Ghostscript-PHP)[ Packagist](https://packagist.org/packages/alchemy/ghostscript)[ RSS](/packages/alchemy-ghostscript/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (8)Used By (3)

Ghostscript PHP driver
======================

[](#ghostscript-php-driver)

[![Build Status](https://camo.githubusercontent.com/dd27df04160f926a8f0ebd5208ad6070926f817b9eb65ab03e79c26fef8520dc/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616c6368656d792d66722f47686f73747363726970742d5048502e706e67)](http://travis-ci.org/alchemy-fr/Ghostscript-PHP)

API usage
=========

[](#api-usage)

To instantiate Ghostscript driver, the easiest way is :

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

You can customize your driver by passing a `Psr\Log\LoggerInterface` or configuration options.

Available options are :

- `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 :

Third and fourth arguments are respectively the first page and the number of page to transcode.

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

To render a file to Image, use the `toImage` method :

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

Silex service provider :
------------------------

[](#silex-service-provider-)

A [Silex](silex.sensiolabs.org) Service Provider is available, all parameters are optionals :

```
$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
=======

[](#license)

Released under the MIT License

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~396 days

Recently: every ~495 days

Total

6

Last Release

2938d ago

Major Versions

0.4.0 → 4.1.02018-05-02

PHP version history (2 changes)0.1.0PHP &gt;=5.3.3

4.1.0PHP ~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c264f69af4c60cb9cc98a522b4663f4b6a2708629cabc14409478ab6fc35348?d=identicon)[romain](/maintainers/romain)

![](https://avatars.githubusercontent.com/u/2437286?v=4)[Benoît Burnichon](/maintainers/bburnichon)[@bburnichon](https://github.com/bburnichon)

![](https://www.gravatar.com/avatar/58d21270e5d40f7ee05bb875b2442496ffd38cec041f7fdcc507b8b040f7e7f8?d=identicon)[thibaud-evaneos](/maintainers/thibaud-evaneos)

![](https://www.gravatar.com/avatar/ee4bb6d5bcc2f9456b41090151c1c8fb288e8949994d965b03b7e25648d663f4?d=identicon)[nmaillat](/maintainers/nmaillat)

---

Top Contributors

[![romainneutron](https://avatars.githubusercontent.com/u/137574?v=4)](https://github.com/romainneutron "romainneutron (29 commits)")[![aztech-dev](https://avatars.githubusercontent.com/u/93562568?v=4)](https://github.com/aztech-dev "aztech-dev (3 commits)")[![douglaslinsmeyer](https://avatars.githubusercontent.com/u/777009?v=4)](https://github.com/douglaslinsmeyer "douglaslinsmeyer (3 commits)")[![mark-pietrus](https://avatars.githubusercontent.com/u/160751557?v=4)](https://github.com/mark-pietrus "mark-pietrus (1 commits)")

---

Tags

pdfghostscript

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alchemy-ghostscript/health.svg)

```
[![Health](https://phpackages.com/badges/alchemy-ghostscript/health.svg)](https://phpackages.com/packages/alchemy-ghostscript)
```

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[tecnickcom/tcpdf

TCPDF is a PHP class for generating PDF documents and barcodes.

4.5k101.8M473](/packages/tecnickcom-tcpdf)[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)[knplabs/knp-snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.

4.5k68.3M56](/packages/knplabs-knp-snappy)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
