PHPackages                             daandesmedt/phpheadlesschrome - 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. daandesmedt/phpheadlesschrome

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

daandesmedt/phpheadlesschrome
=============================

A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.

v1.1.2(1y ago)92233.1k—2.3%20MITPHPCI passing

Since Nov 20Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/DaanDeSmedt/PHPHeadlessChrome)[ Packagist](https://packagist.org/packages/daandesmedt/phpheadlesschrome)[ RSS](/packages/daandesmedt-phpheadlesschrome/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (13)Used By (0)

PHPHeadlessChrome
=================

[](#phpheadlesschrome)

Headless Chrome is shipping in Chrome 59. It's a way to run the Chrome browser in a headless environment. Essentially, running Chrome without chrome! It brings all modern web platform features provided by Chromium and the Blink rendering engine to the command line.

PHPHeadlessChrome provides a simple usage helper class to create PDF and / or screenshots using a Headless Chrome instance. **Trigger PDF / Screenshots generation for webpages / string HTML or local URL.**

In order to use this PHPHeadlessChrome helper make sure Google Chrome is correctly installer from version 59 or onwards.

[![Latest Stable Version](https://camo.githubusercontent.com/1eaa40284081630bb2d5d86fd99159b08fd31caec6d9e9a93a98bfd520837288/68747470733a2f2f706f7365722e707567782e6f72672f6461616e6465736d6564742f706870686561646c6573736368726f6d652f76)](https://packagist.org/packages/daandesmedt/phpheadlesschrome)[![Total Downloads](https://camo.githubusercontent.com/591415d626a355402249d36e16338032a86f804d9ae690767290510552e16e96/68747470733a2f2f706f7365722e707567782e6f72672f6461616e6465736d6564742f706870686561646c6573736368726f6d652f646f776e6c6f616473)](https://packagist.org/packages/daandesmedt/phpheadlesschrome)[![Daily Downloads](https://camo.githubusercontent.com/15299bab9d055b9edc2b5bfedeb8909c5a57ebc1cc4dcfad5567271dc8909525/68747470733a2f2f706f7365722e707567782e6f72672f6461616e6465736d6564742f706870686561646c6573736368726f6d652f642f6461696c79)](https://packagist.org/packages/daandesmedt/phpheadlesschrome)[![License](https://camo.githubusercontent.com/219a12da80b4ecccf2cb333ef07f914086703e8620bdf2fbb69e8256125b1baf/68747470733a2f2f706f7365722e707567782e6f72672f6461616e6465736d6564742f706870686561646c6573736368726f6d652f6c6963656e7365)](https://packagist.org/packages/daandesmedt/phpheadlesschrome)

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

[](#installation)

Install the package through [composer](http://getcomposer.org):

```
composer require daandesmedt/phpheadlesschrome

```

Make sure, that you include the composer [autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading) somewhere in your codebase.

Usage
-----

[](#usage)

Use the `PHPHeadlessChrome` tool when you want to convert a webpage / HTML text or (local) HTML file to a PDF or image screenshot.

Working examples
----------------

[](#working-examples)

Working examples can be found in the `examples` folder.

Webpage (URL) to PDF
--------------------

[](#webpage-url-to-pdf)

```
