PHPackages                             ottosmops/pdfvalidate - 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. ottosmops/pdfvalidate

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

ottosmops/pdfvalidate
=====================

A simple validation for pdfs

v2.0.0(5y ago)3142↓100%MITPHPPHP &gt;=5.6.0CI failing

Since May 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ottosmops/Pdfvalidate)[ Packagist](https://packagist.org/packages/ottosmops/pdfvalidate)[ Docs](https://github.com/ottosmops/pdfvalidate)[ RSS](/packages/ottosmops-pdfvalidate/feed)WikiDiscussions master Synced 2mo ago

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

Validate a PDF with pdftocairo
==============================

[](#validate-a-pdf-with-pdftocairo)

[![GitHub license](https://camo.githubusercontent.com/dadc46f17d65cd3d28d71a1e2d6d1eeff51e8addaae757fa517cb30b01e46640/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f74746f736d6f70732f70646676616c69646174652e737667)](https://github.com/ottosmops/pdfvalidate/blob/master/LICENSE.md)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/94d58d59a49539441e092b936f0756964cadf496739bd83bd369493a771ef320/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f74746f736d6f70732f70646676616c69646174652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ottosmops/pdfvalidate/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6c2ff65179a693d5d646c2e6d15daf35942767b2812e878f72b7f9e91524daa2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f74746f736d6f70732f70646676616c69646174652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ottosmops/pdfvalidate/?branch=master)[![Build Status](https://camo.githubusercontent.com/41aad54731a63915fe6507e13fdc7a9fcbfdd0d29635446fab775c0038c81066/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f74746f736d6f70732f70646676616c69646174652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ottosmops/pdfvalidate/build-status/master)[![Latest Stable Version](https://camo.githubusercontent.com/8d51996299e3658b36f491cbdb8551a37db417292ad8fc8f31b06149f1bd8552/68747470733a2f2f706f7365722e707567782e6f72672f6f74746f736d6f70732f70646676616c69646174652f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/ottosmops/pdfvalidate)[![Packagist Downloads](https://camo.githubusercontent.com/5f445f6a2a255a6a93f69a55a6566f268645bfe45aa3d81341ec9bfc41fc65ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f74746f736d6f70732f70646676616c69646174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ottosmops/pdfvalidate)

This package provides a very simple PDF Validator. In fact you can only check if the Pdf is readable by `pdftocairo` without problems.

```
$validator = new \Ottosmops\Pdfvalidate\Validator('/path/to/file.pdf');
if (!$validator->check()) {
    echo $validator->error;
    echo $validator->output; // original information
    exit(1);
}

// the pdf should be ok
// do something useful ...
```

This is the command which is used behind the scene: `pdftocairo -pdf path/to/file - 2>&1 >/dev/null`.

There are 2 optional parameters: `$executable` (path to the command); `$timeout` (in seconds):

```
$validator = new \Ottosmops\Pdfvalidate\Validator($file, $executable = '', $timeout = 60);
```

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

[](#requirements)

The Package uses [pdftocairo](https://linux.die.net/man/1/pdftocairo). Make sure that this is installed: `which pdftocairo`

For Installation see: [poppler-utils](https://linuxappfinder.com/package/poppler-utils)

If the installed binary is not found ("`The command "which pdftoppm" failed.`") you can pass the full path to the `_constructor` (see below) or use `putenv('PATH=$PATH:/usr/local/bin/:/usr/bin')` (with the dir where pdftoppm lives) before you call the class `Converter`.

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

[](#installation)

```
composer require ottosmops/pdfvalidate
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

Every ~209 days

Total

5

Last Release

2085d ago

Major Versions

v1.0.3 → v2.0.02020-08-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/76f31e7e6772db47a91388ed82840fae1fa57185bb82a64924bb3839697222c2?d=identicon)[ottosmops](/maintainers/ottosmops)

---

Top Contributors

[![ottosmops](https://avatars.githubusercontent.com/u/4144389?v=4)](https://github.com/ottosmops "ottosmops (13 commits)")

---

Tags

pdfvalidationantonottosmops

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ottosmops-pdfvalidate/health.svg)

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

###  Alternatives

[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)[chrome-php/chrome

Instrument headless chrome/chromium instances from PHP

2.6k4.5M64](/packages/chrome-php-chrome)[pontedilana/php-weasyprint

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

761.1M7](/packages/pontedilana-php-weasyprint)[mostafaznv/pdf-optimizer

PDF optimization tool for PHP and Laravel applications

170125.8k](/packages/mostafaznv-pdf-optimizer)[mnvx/lowrapper

PHP wrapper over LibreOffice converter

129190.5k](/packages/mnvx-lowrapper)

PHPackages © 2026

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