PHPackages                             chrisnharvey/pdfkit - 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. chrisnharvey/pdfkit

ActiveLibrary

chrisnharvey/pdfkit
===================

HTML to PDF converter for PHP using WebKit. Uses the wkhtmltopdf C library via FFI.

313PHP

Since Oct 19Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PDFKit for PHP
==============

[](#pdfkit-for-php)

PDFKit is a PHP package that converts HTML to PDFs using WebKit.

Uses the [wkhtmltopdf](http://github.com/antialize/wkhtmltopdf) C library via PHP FFI.

*Note: This package is a work in progress and its API is subject to change. Use in production environments not recommended.*

Requirements
------------

[](#requirements)

- PHP 7.4 or later
- FFI extension (see Dockerfile)
- wkhtmltopdf library (see Dockerfile)

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

[](#installation)

```
composer require chrisnharvey/pdfkit

```

Usage
-----

[](#usage)

```
use ChrisHarvey\PDFKit\PDFKit;
use ChrisHarvey\PDFKit\ConversionFailedException;

$pdfkit = new PDFKit();

// Add a page to the pdf
$pdfkit->add([
    'page' => 'http://example.com'
]);

$pdfkit->saveTo('example.pdf');

$pdfkit->onStageChanged(function () {
    echo "Moved to next stage";
});

$pdfKit->onProgressChanged(function ($percent) {
    echo $percent; // Print percentage
});

try {
    $pdfkit->convert();
} catch (ConversionFailedException $e) {
    print_r($e->getErrors());
    print_r($e->getWarnings());
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/424e68b8215f79181064984c07fbc268b9b9a5f0ea503a298e76e05a9c70d4d4?d=identicon)[chrisnharvey](/maintainers/chrisnharvey)

---

Top Contributors

[![chrisnharvey](https://avatars.githubusercontent.com/u/619298?v=4)](https://github.com/chrisnharvey "chrisnharvey (7 commits)")

### Embed Badge

![Health badge](/badges/chrisnharvey-pdfkit/health.svg)

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

PHPackages © 2026

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