PHPackages                             org\_heigl/pdfunit - 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. org\_heigl/pdfunit

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

org\_heigl/pdfunit
==================

Unittests for comparing PDF-files

1.0.0(10y ago)024MITPHP

Since Jun 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/heiglandreas/pdfunit)[ Packagist](https://packagist.org/packages/org_heigl/pdfunit)[ Docs](https://github.com/heiglandreas/PDFUnit)[ RSS](/packages/org-heigl-pdfunit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (2)Used By (0)

PDFUnit
=======

[](#pdfunit)

An extension to PHPUnit to test creation of PDF-Files.

About
-----

[](#about)

Creating PDF-Files is always a bit difficult as the best comparison is a visual one.

As 2 PDF-Files can be internally completely different there is no way of comparing them on a source-code-level. Therefore comparing them by creating an image and comparing that to a known-good file. The differences between the two files are calculated and measured against a threshold.

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

[](#requirements)

This package requires imagemagicks `compare`-binary to be installed and available in the path.

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

[](#installation)

```
$ composer require org_heigl/pdfunit

```

Usage
-----

[](#usage)

```
namespace Acme;

use Org_Heigl\PDFUnit\TestCase;

class PDFTest extends TestCase
{
    public function testPdf()
    {
        $this->assertPdfDiffBelowThreshold(
            'known-good.pdf',
            0.4,
            'generated.pdf'
        );
    }
}

```

This will compare `generated.pdf` agains `known-good.pdf` and checks whether the difference is less or equals to 0.4.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3988d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ae5183aaad2bc7453230704bd6991dc6ccbcd6e775c6a29efdc94350a69f247?d=identicon)[heiglandreas](/maintainers/heiglandreas)

---

Top Contributors

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

---

Tags

pdfunittestunittests

### Embed Badge

![Health badge](/badges/org-heigl-pdfunit/health.svg)

```
[![Health](https://phpackages.com/badges/org-heigl-pdfunit/health.svg)](https://phpackages.com/packages/org-heigl-pdfunit)
```

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[tecnickcom/tcpdf

TCPDF is a PHP class for generating PDF documents and barcodes.

4.5k101.8M473](/packages/tecnickcom-tcpdf)[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)[knplabs/knp-snappy

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

4.5k68.3M56](/packages/knplabs-knp-snappy)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)

PHPackages © 2026

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