PHPackages                             clippings/phantom-pdf - 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. clippings/phantom-pdf

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

clippings/phantom-pdf
=====================

A Package for generating PDF files using PhantomJS

0.12.0(6y ago)487.6kMITPHPPHP ^7.1

Since May 26Pushed 6y ago9 watchersCompare

[ Source](https://github.com/clippings/phantom-pdf)[ Packagist](https://packagist.org/packages/clippings/phantom-pdf)[ RSS](/packages/clippings-phantom-pdf/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (25)Used By (0)

Phantom PDF
===========

[](#phantom-pdf)

[![Build Status](https://camo.githubusercontent.com/05edb768d7912ea233cec279d2a7149ce6fbc2798578db58f16e06392ecb3ffb/68747470733a2f2f7472617669732d63692e6f72672f636c697070696e67732f7068616e746f6d2d7064662e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/clippings/phantom-pdf)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6bb2d834f15541c77c2d9be172bf27cff985378abe44ff583fe3b4b9af8581f5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c697070696e67732f7068616e746f6d2d7064662f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/clippings/phantom-pdf/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/dfd95e77410b8a28171324585afe8dffdbc8f2aa1400216fc1b52383e7d673e2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c697070696e67732f7068616e746f6d2d7064662f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/clippings/phantom-pdf/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/027df6fea0d82c8e29ebd0a9ae91d7f020c2d40455022f659e88feaf60208228/68747470733a2f2f706f7365722e707567782e6f72672f636c697070696e67732f7068616e746f6d2d7064662f762f737461626c652e706e67)](https://packagist.org/packages/clippings/phantom-pdf)

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

[](#installation)

Install via composer

```
$ composer global require clippings/phantom-pdf

```

Usage
-----

[](#usage)

```
$pdf = new PdfGenerator();

// Set a writable path for temporary files
$pdf->setStoragePath('storage/path');

// Saves the PDF as a file
$pdf->saveFromView($html, 'filename.pdf');
```

Use `setBinaryPath('path')` to use another version of PhantomJS.

Customizing the conversion script
---------------------------------

[](#customizing-the-conversion-script)

If you want to use another script to execute with PhantomJS, this it how you do it.

```
$pdf->useScript('path/to/script');

return $pdf->saveFromView('view');
```

Credits
-------

[](#credits)

Forked from the great  package

Copyright (c) 2015, Clippings Ltd. Refactored by [Ivan Kerin](https://github.com/ivank) as part of [clippings.com](http://clippings.com)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53% 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 ~99 days

Recently: every ~389 days

Total

22

Last Release

2334d ago

PHP version history (3 changes)v0.0.1PHP &gt;=5.4.0

0.11.0PHP ^7.0

0.12.0PHP ^7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/506129?v=4)[Harry Dobrev](/maintainers/hkdobrev)[@hkdobrev](https://github.com/hkdobrev)

![](https://avatars.githubusercontent.com/u/4113307?v=4)[Danail Kyosev](/maintainers/dkyosev)[@dkyosev](https://github.com/dkyosev)

---

Top Contributors

[![danielboendergaard](https://avatars.githubusercontent.com/u/314877?v=4)](https://github.com/danielboendergaard "danielboendergaard (35 commits)")[![ivank](https://avatars.githubusercontent.com/u/4976?v=4)](https://github.com/ivank "ivank (14 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (7 commits)")[![stanstst](https://avatars.githubusercontent.com/u/9391542?v=4)](https://github.com/stanstst "stanstst (5 commits)")[![phgeorgiev](https://avatars.githubusercontent.com/u/745771?v=4)](https://github.com/phgeorgiev "phgeorgiev (3 commits)")[![Seb33300](https://avatars.githubusercontent.com/u/915273?v=4)](https://github.com/Seb33300 "Seb33300 (1 commits)")[![przemekperon](https://avatars.githubusercontent.com/u/169778?v=4)](https://github.com/przemekperon "przemekperon (1 commits)")

---

Tags

pdfhtmlphantomjs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/clippings-phantom-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/clippings-phantom-pdf/health.svg)](https://phpackages.com/packages/clippings-phantom-pdf)
```

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k36.7M156](/packages/spatie-browsershot)[knplabs/knp-snappy

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

4.5k72.4M62](/packages/knplabs-knp-snappy)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[pontedilana/php-weasyprint

PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.

781.2M17](/packages/pontedilana-php-weasyprint)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3856.2M31](/packages/gotenberg-gotenberg-php)[danielboendergaard/phantom-pdf

A Package for generating PDF files using PhantomJS

72478.7k](/packages/danielboendergaard-phantom-pdf)

PHPackages © 2026

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