PHPackages                             devture/browserless - 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. devture/browserless

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

devture/browserless
===================

Library for communicating with the Browserless.io API (generating PDFs, etc.)

2.0.1(7mo ago)310.4k↓56.1%BSD-3-ClausePHPPHP &gt;=8.0

Since Mar 17Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/devture/browserless)[ Packagist](https://packagist.org/packages/devture/browserless)[ RSS](/packages/devture-browserless/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (8)Used By (0)

Browserless
===========

[](#browserless)

This is a library for interacting with the [Browserless.io](https://www.browserless.io) APIs.

For the time being, this library only supports these APIs:

- [/pdf](https://docs.browserless.io/docs/pdf.html) - for generating PDFs from a URL or inline HTML (like [wkhtmltopdf](https://wkhtmltopdf.org/), but better -- more up-to-date browser engine, etc.)

Prerequisites
-------------

[](#prerequisites)

You either need to use your own self-hosted Browserless instance (see how to do it with [Docker](https://docs.browserless.io/docker/quickstart)) or their hosted offering (see [Pricing](https://www.browserless.io/pricing/)).

You could use the following `compose.yml` setup:

```
version: '2.1'

services:
  browserless:
    image: ghcr.io/browserless/chromium:v2.23.0
    restart: unless-stopped
    # Matches the owner (`blessuser:blessuser`) of `/usr/src/app`
    user: 999:999
    environment:
      CONCURRENT: 10
      TOKEN: SOME_TOKEN_HERE
    # Not exposing the port is recommended, if PHP is running in a container alongisde this one
    ports:
      - "127.0.0.1:3000:3000"
    tmpfs:
      - /tmp
```

Usage
-----

[](#usage)

### Creating a Browserless API client

[](#creating-a-browserless-api-client)

```
$browserlessApiUrl = 'http://localhost:3000'; // Or 'http://browserless:3000', etc.
$browserlessToken = 'SOME_TOKEN_HERE';
$browserlessTimeoutSeconds = 15;

$client = new \Devture\Component\Browserless\Client(
	new \GuzzleHttp\Client(),
	$browserlessApiUrl,
	$browserlessToken,
	$browserlessTimeoutSeconds,
);
```

### Generating a PDF from a URL

[](#generating-a-pdf-from-a-url)

```
$url = 'https://devture.com';

$pdfCreationRequest = new \Devture\Component\Browserless\Model\PdfCreationRequest();
$pdfCreationRequest->setUrl($url);
$pdfCreationRequest->setOptions([
	'printBackground' => true,
	'format' => 'A4',
	'landscape' => true,
]);

$pdfBytes = $client->createPdfFromRequest($pdfCreationRequest);
```

### Generating a PDF from inline HTML

[](#generating-a-pdf-from-inline-html)

```
$html = 'Some HTML here';

$pdfCreationRequest = new \Devture\Component\Browserless\Model\PdfCreationRequest();
$pdfCreationRequest->setHtml($html);
$pdfCreationRequest->setOptions([
	'printBackground' => true,
	'format' => 'A4',
	'margin' => [
		'top' => '20mm',
		'bottom' => '10mm',
		'left' => '10mm',
		'right' => '10mm',
	],
]);

$pdfBytes = $client->createPdfFromRequest($pdfCreationRequest);
```

Alternatives
------------

[](#alternatives)

- [gosuperscript/browserless-php](https://packagist.org/packages/gosuperscript/browserless-php)
- the [SynergiTech/chrome-pdf-php](https://github.com/SynergiTech/chrome-pdf-php) library can also render PDFs via Browserless
- [wkhtmltopdf](https://wkhtmltopdf.org/) invoked via [knplabs/knp-snappy](https://github.com/KnpLabs/snappy)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance65

Regular maintenance activity

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~226 days

Recently: every ~261 days

Total

7

Last Release

211d ago

Major Versions

1.1.0 → 2.02024-11-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/9daf523f8e47ddeb8af23183c06721c4e89111eb4eb3f9ce264242b373e9dd80?d=identicon)[spantaleev](/maintainers/spantaleev)

---

Top Contributors

[![spantaleev](https://avatars.githubusercontent.com/u/388669?v=4)](https://github.com/spantaleev "spantaleev (8 commits)")

---

Tags

browserlesschromepdfpdf-generationpuppeteerpdfchromebrowserless

### Embed Badge

![Health badge](/badges/devture-browserless/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.0k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M734](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)

PHPackages © 2026

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