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

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

antking/phantom-pdf
===================

A Package for generating PDF files using PhantomJS, which fork from danielboendergaard/phantom-pdf

v0.6.2(10y ago)02.0k1MITPHPPHP &gt;=5.4.0

Since May 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/TrungVuAnt/phantom-pdf)[ Packagist](https://packagist.org/packages/antking/phantom-pdf)[ RSS](/packages/antking-phantom-pdf/feed)WikiDiscussions master Synced 1mo ago

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

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

[](#phantom-pdf)

A Package for generating PDF files using PhantomJS. The package is framework agnostic, but provides integration with Laravel 4/5.

Notice: This package only works on 64-bit Linux operating systems.

\##Installation Run `composer require antking/phantom-pdf`

\####Laravel 4 Installation (optional)

Add `PhantomPdfServiceProvider` in the `providers` array in `app/config/app.php`

```
'providers' => [
  ...
  'PhantomPdf\Laravel\PhantomPdfServiceProvider'
]

```

\####Laravel 5 Installation (optional)

Add `Laravel5ServiceProvider` in the `providers` array in `config/app.php`

```
'providers' => [
  ...
  'PhantomPdf\Laravel\Laravel5ServiceProvider'
]

```

#### Laravel 4/5 Facade usage (optional)

[](#laravel-45-facade-usage-optional)

Add the facade to the `aliases` array in `app/config/app.php` (optional)

```
'aliases' => [
  ...
  'PDF' => 'PhantomPdf\Laravel\PDFFacade'
]

```

\##Usage with Laravel

```
class SampleController extends Controller {

  public function index()
  {
    $view = View::make('index');

    return PDF::createFromView($view, 'filename.pdf');
  }

  public function save()
  {
      $view = View::make('index');

      PDF::saveFromView($view, 'path/filename.pdf');
  }
}
```

\##Usage outside Laravel

```
$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');

// Returns a Symfony\Component\HttpFoundation\BinaryFileResponse
return $pdf->createFromView($html, 'filename.pdf');
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.3% 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 ~34 days

Recently: every ~22 days

Total

12

Last Release

3998d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39c5659d13d84933235ab701954b51874d319eabbfff6f2b8ecbec9ad8bc461e?d=identicon)[TrungVuAnt](/maintainers/TrungVuAnt)

---

Top Contributors

[![danielboendergaard](https://avatars.githubusercontent.com/u/314877?v=4)](https://github.com/danielboendergaard "danielboendergaard (28 commits)")[![TrungVuDang](https://avatars.githubusercontent.com/u/8068759?v=4)](https://github.com/TrungVuDang "TrungVuDang (3 commits)")

---

Tags

laravelpdfhtml

### Embed Badge

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

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

###  Alternatives

[danielboendergaard/phantom-pdf

A Package for generating PDF files using PhantomJS

72467.9k](/packages/danielboendergaard-phantom-pdf)[mostafaznv/pdf-optimizer

PDF optimization tool for PHP and Laravel applications

170125.8k](/packages/mostafaznv-pdf-optimizer)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.2k](/packages/nilgems-laravel-textract)[eve/pdf-converter

Laravel package to convert HTML to PDF, supporting multiple drivers.

114.1k](/packages/eve-pdf-converter)

PHPackages © 2026

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