PHPackages                             konsulting/assert-pdfs - 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. konsulting/assert-pdfs

ActiveLibrary

konsulting/assert-pdfs
======================

Simple PHP(Unit) Package to help with making assertions on PDFs

0.1.0(6y ago)031MITPHP

Since Sep 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/konsulting/assert-pdfs)[ Packagist](https://packagist.org/packages/konsulting/assert-pdfs)[ RSS](/packages/konsulting-assert-pdfs/feed)WikiDiscussions master Synced 2mo ago

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

assert-pdfs
===========

[](#assert-pdfs)

A simple assertion package to work with PDFs and PHPUnit.

Please ensure that you have Imagick install/available and it has permission to write to PDF ([see this post on stack overflow](https://stackoverflow.com/a/38222027)). You may need to run something like:

` sudo sed -i -e 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml`

This is effectively a package up of [this starting point from Gordon Lesti](https://gordonlesti.com/phpunit-compare-generated-pdf-files-with-imagick).

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

[](#installation)

`composer require --dev konsulting/assert-pdfs`

Usage
-----

[](#usage)

Use the `Konsulting\Testing\AssertPdfs` trait on your test class. Available methods:

` assertPdfSame($assertedPdf, $testPdf, $saveDiffToFile = null)` - You can optionally save the diff of the pdf on failure to a file by providing a path to save to.

Hopefully we can add some more methods when we need them (or you do).

Contribution
------------

[](#contribution)

Please feel free to contribute.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.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

Unknown

Total

1

Last Release

2431d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4703657?v=4)[Konsulting](/maintainers/konsulting)[@konsulting](https://github.com/konsulting)

---

Top Contributors

[![Keoghan](https://avatars.githubusercontent.com/u/6714599?v=4)](https://github.com/Keoghan "Keoghan (7 commits)")[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konsulting-assert-pdfs/health.svg)

```
[![Health](https://phpackages.com/badges/konsulting-assert-pdfs/health.svg)](https://phpackages.com/packages/konsulting-assert-pdfs)
```

PHPackages © 2026

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