PHPackages                             rauny-henrique/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rauny-henrique/ghostscript

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rauny-henrique/ghostscript
==========================

Ghostscript is an object oriented Ghostscript binary wrapper for PHP.

0966PHP

Since Apr 11Pushed 4y agoCompare

[ Source](https://github.com/rauny-henrique/Ghostscript)[ Packagist](https://packagist.org/packages/rauny-henrique/ghostscript)[ RSS](/packages/rauny-henrique-ghostscript/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Ghostscript
===========

[](#ghostscript)

[![Latest Version on Packagist](https://camo.githubusercontent.com/205fa79a9b4d1cbca89b4816daa1bbf9670616396deeea1448696b2029c6ee4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677261766974796d656469612f67686f73747363726970742e737667)](https://packagist.org/packages/gravitymedia/ghostscript)[![Software License](https://camo.githubusercontent.com/194459b7f322331ac3a065327c6200ff8629e64de5cbefc7f4f726aa38e43e1e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f677261766974796d656469612f67686f73747363726970742e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/933fd6be4ccd16616593063f5cbd761c08c1a88f77275ade74b84fa80b8c836b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f477261766974794d656469612f47686f73747363726970742e737667)](https://travis-ci.org/GravityMedia/Ghostscript)[![Coverage Status](https://camo.githubusercontent.com/8535ae4dce666f15c2d912db32f44691b3395ebedfeeaf66d3502bb2a36a6996/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f477261766974794d656469612f47686f73747363726970742e737667)](https://scrutinizer-ci.com/g/GravityMedia/Ghostscript/code-structure)[![Quality Score](https://camo.githubusercontent.com/68d6c7c68281434f61029e9992f64647482386f8007048ec000cc3bd08b62b68/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f477261766974794d656469612f47686f73747363726970742e737667)](https://scrutinizer-ci.com/g/GravityMedia/Ghostscript)[![Total Downloads](https://camo.githubusercontent.com/25d332025cdbb214edd3dda0e86eda74c0082b755e8bd87a3911ea9d1076defb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677261766974796d656469612f67686f73747363726970742e737667)](https://packagist.org/packages/gravitymedia/ghostscript)[![Dependency Status](https://camo.githubusercontent.com/30d3595ba9faf8c4595dce4bb8d41234503a674041c446e38e7a6f20f856234a/68747470733a2f2f696d672e736869656c64732e696f2f76657273696f6e6579652f642f7068702f677261766974796d656469613a67686f73747363726970742e737667)](https://www.versioneye.com/user/projects/54a6c25c27b014d85a000150)

Ghostscript is an object oriented Ghostscript binary wrapper for PHP.

Requirements
------------

[](#requirements)

This library has the following requirements:

- PHP 7.1+
- Ghostscript 9.00+

Installation
------------

[](#installation)

Install Composer in your project:

```
$ curl -s https://getcomposer.org/installer | php
```

Require the package via Composer:

```
$ composer require rauny-henrique/ghostscript
```

Usage
-----

[](#usage)

This is a simple usage example how to convert an input PDF to an output PDF.

```
// Initialize autoloader
require_once __DIR__ . '/vendor/autoload.php';

// Import classes
use GravityMedia\Ghostscript\Ghostscript;
use Symfony\Component\Process\Process;

// Define input and output files
$inputFile = '/path/to/input/file.pdf';
$outputFile = '/path/to/output/file.pdf';

// Create Ghostscript object
$ghostscript = new Ghostscript([
    'quiet' => false
]);

// Create and configure the device
$device = $ghostscript->createPdfDevice($outputFile);
$device->setCompatibilityLevel(1.4);

// Create process
$process = $device->createProcess($inputFile);

// Print the command line
print '$ ' . $process->getCommandLine() . PHP_EOL;

// Run process
$process->run(function ($type, $buffer) {
    if ($type === Process::ERR) {
        throw new \RuntimeException($buffer);
    }

    print $buffer;
});
```

Testing
-------

[](#testing)

Clone this repository, install Composer and all dependencies:

```
$ php composer.phar install
```

Run the test suite:

```
$ php composer.phar test
```

Generating documentation
------------------------

[](#generating-documentation)

Clone this repository, install Composer and all dependencies:

```
$ php composer.phar install
```

Generate the documentation to the `build/docs` directory:

```
$ php composer.phar doc
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Daniel Schröder](https://github.com/pCoLaSD)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/99811376?v=4)[raunyhenrique](/maintainers/raunyhenrique)[@raunyhenrique](https://github.com/raunyhenrique)

---

Top Contributors

[![BreiteSeite](https://avatars.githubusercontent.com/u/2171105?v=4)](https://github.com/BreiteSeite "BreiteSeite (8 commits)")[![schroedan](https://avatars.githubusercontent.com/u/4107232?v=4)](https://github.com/schroedan "schroedan (6 commits)")[![rauny-henrique](https://avatars.githubusercontent.com/u/21957273?v=4)](https://github.com/rauny-henrique "rauny-henrique (3 commits)")[![fgilio](https://avatars.githubusercontent.com/u/6857732?v=4)](https://github.com/fgilio "fgilio (1 commits)")[![wsilva94](https://avatars.githubusercontent.com/u/30603134?v=4)](https://github.com/wsilva94 "wsilva94 (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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