PHPackages                             short-edition/gotenberg-php-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. short-edition/gotenberg-php-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

short-edition/gotenberg-php-client
==================================

A client for sending files to a Gotenberg API

013.1k1PHP

Since Jan 28Pushed 3mo agoCompare

[ Source](https://github.com/short-edition/gotenberg-php-client)[ Packagist](https://packagist.org/packages/short-edition/gotenberg-php-client)[ RSS](/packages/short-edition-gotenberg-php-client/feed)WikiDiscussions bugfix Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

⚠️ For **Gotenberg 7.x**, use [gotenberg-/gotenberg-php](https://github.com/gotenberg/gotenberg-php) instead.

*This library is unmaintained and will not receive updates. Consider migrating to *Gotenberg 7.x* and the according new library instead.*

Gotenberg PHP client
====================

[](#gotenberg-php-client)

A simple PHP client for interacting with a Gotenberg API.

Install
-------

[](#install)

Unless your project already have a PSR7 `HttpClient`, install `php-http/guzzle6-adapter`:

```
$ composer require php-http/guzzle6-adapter
```

Then the PHP client:

```
$ composer require thecodingmachine/gotenberg-php-client
```

Usage
-----

[](#usage)

```
use TheCodingMachine\Gotenberg\Client;
use TheCodingMachine\Gotenberg\ClientException;
use TheCodingMachine\Gotenberg\DocumentFactory;
use TheCodingMachine\Gotenberg\HTMLRequest;
use TheCodingMachine\Gotenberg\Request;
use TheCodingMachine\Gotenberg\RequestException;
use GuzzleHttp\Psr7\LazyOpenStream;

# create the client.
$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
# ... or the following if you want the client to discover automatically an installed implementation of the PSR7 `HttpClient`.
$client = new Client('http://localhost:3000');

# prepare the files required for your conversion.

# from a path.
$index = DocumentFactory::makeFromPath('index.html', '/path/to/file');
# ... or from your own stream.
$stream = new LazyOpenStream('/path/to/file', 'r');
$index = DocumentFactory::makeFromStream('index.html', $stream);
// ... or from a string.
$index = DocumentFactory::makeFromString('index.html', 'Foo');

$header = DocumentFactory::makeFromPath('header.html', '/path/to/file');
$footer = DocumentFactory::makeFromPath('footer.html', '/path/to/file');
$assets = [
    DocumentFactory::makeFromPath('style.css', '/path/to/file'),
    DocumentFactory::makeFromPath('img.png', '/path/to/file'),
];

try {
    $request = new HTMLRequest($index);
    $request->setHeader($header);
    $request->setFooter($footer);
    $request->setAssets($assets);
    $request->setPaperSize(Request::A4);
    $request->setMargins(Request::NO_MARGINS);
    $request->setScale(0.75);

    # store method allows you to... store the resulting PDF in a particular destination.
    $client->store($request, 'path/you/want/the/pdf/to/be/stored.pdf');

    # if you wish to redirect the response directly to the browser, you may also use:
    $client->post($request);
} catch (RequestException $e) {
    # this exception is thrown if given paper size or margins are not correct.
} catch (ClientException $e) {
    # this exception is thrown by the client if the API has returned a code != 200.
}
```

For more complete usages, head to the [documentation](https://gotenberg.dev/).

Badges
------

[](#badges)

[![Travis CI](https://camo.githubusercontent.com/b210f20f6ca01d84fbc8179170a32c45ed1d046e8639f5976609c5070773ae4b/68747470733a2f2f7472617669732d63692e6f72672f746865636f64696e676d616368696e652f676f74656e626572672d7068702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thecodingmachine/gotenberg-php-client)[![Scrutinizer](https://camo.githubusercontent.com/046856bd109709be06e06fa6cc79d4cf77b6db3d2818a85bc073582e61d49948/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865636f64696e676d616368696e652f676f74656e626572672d7068702d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thecodingmachine/gotenberg-php-client/?branch=master)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance53

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor3

3 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://www.gravatar.com/avatar/8ed9c052cd74b1812012e16857fbd6cf039c65874879276851733b77361a8200?d=identicon)[YoannChabert](/maintainers/YoannChabert)

---

Top Contributors

[![rodnaph](https://avatars.githubusercontent.com/u/447579?v=4)](https://github.com/rodnaph "rodnaph (4 commits)")[![gulien](https://avatars.githubusercontent.com/u/8983173?v=4)](https://github.com/gulien "gulien (4 commits)")[![YoannChabert](https://avatars.githubusercontent.com/u/9531092?v=4)](https://github.com/YoannChabert "YoannChabert (4 commits)")[![bendavies](https://avatars.githubusercontent.com/u/625392?v=4)](https://github.com/bendavies "bendavies (1 commits)")[![tigitz](https://avatars.githubusercontent.com/u/1524501?v=4)](https://github.com/tigitz "tigitz (1 commits)")[![mdjward](https://avatars.githubusercontent.com/u/4046455?v=4)](https://github.com/mdjward "mdjward (1 commits)")[![florentdestremau](https://avatars.githubusercontent.com/u/2852204?v=4)](https://github.com/florentdestremau "florentdestremau (1 commits)")[![lcp0578](https://avatars.githubusercontent.com/u/10859621?v=4)](https://github.com/lcp0578 "lcp0578 (1 commits)")

### Embed Badge

![Health badge](/badges/short-edition-gotenberg-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/short-edition-gotenberg-php-client/health.svg)](https://phpackages.com/packages/short-edition-gotenberg-php-client)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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