PHPackages                             viterbit/pdfimages-extractor - 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. [Image &amp; Media](/categories/media)
4. /
5. viterbit/pdfimages-extractor

ActiveLibrary[Image &amp; Media](/categories/media)

viterbit/pdfimages-extractor
============================

Extract images from pdf

v0.2.1(1y ago)272.0k↑71.3%MITPHPPHP ^7.3|^8.0

Since Sep 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/viterbit/pdfimages-extractor)[ Packagist](https://packagist.org/packages/viterbit/pdfimages-extractor)[ Docs](https://github.com/viterbit/pdfimages-extractor)[ RSS](/packages/viterbit-pdfimages-extractor/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Extract images from a pdf
=========================

[](#extract-images-from-a-pdf)

This package provides a class to extract images from a pdf.

```
use Viterbit\PdfImagesExtractor\Pdf;

$images = Pdf::getImages('book.pdf'); //returns a FilesystemIterator
```

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

[](#requirements)

Behind the scenes this package leverages [pdfimages](https://en.wikipedia.org/wiki/Pdfimages). You can verify if the binary installed on your system by issuing this command:

```
which pdfimages
```

If it is installed it will return the path to the binary.

To install the binary you can use this command on Ubuntu or Debian:

```
apt-get install poppler-utils
```

On a mac you can install the binary using brew

```
brew install poppler
```

If you're on RedHat or CentOS use this:

```
yum install poppler-utils
```

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

[](#installation)

You can install the package via composer:

```
composer viterbit/pdfimages-extractor
```

Usage
-----

[](#usage)

Getting images from a pdf is easy.

```
$images = (new Pdf())
    ->setPdf('book.pdf')
    ->images();
```

Or easier:

```
$images = Pdf::getImages('book.pdf');
```

By default the package will assume that the `pdftoimages` command is located at `/usr/bin/pdftoimages`. If it is located elsewhere pass its binary path to constructor

```
$images = (new Pdf('/custom/path/to/pdftoimages'))
    ->setPdf('book.pdf')
    ->images();
```

or as the second parameter to the `getImages` static method:

```
echo Pdf::getText('book.pdf', '/custom/path/to/pdftoimages');
```

Sometimes you may want to use [pdfimages options](https://linux.die.net/man/1/pdfimages). To do so you can set them up using the `setOptions` method.

```
$images = (new Pdf())
    ->setPdf('book.pdf')
    ->setOptions(['j', 'f 1'])
    ->images()
;
```

or as the third parameter to the `getImages` static method:

```
$images = Pdf::getImages('book.pdf', null, ['j', 'f 1']);
```

Please note that successive calls to `setOptions()` will overwrite options passed in during previous calls.

If you need to make multiple calls to add options (for example if you need to pass in default options when creating the `Pdf` object from a container, and then add context-specific options elsewhere), you can use the `addOptions()` method:

```
$images = (new Pdf())
    ->setPdf('book.pdf')
    ->addOptions(['f 1'])
    ->images()
;
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information about what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker. design agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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 ~531 days

Total

3

Last Release

682d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6a33e58698c721e8320faec7ff2781101b276c0cb2eaa70619084a1d60ab889?d=identicon)[markitosgv](/maintainers/markitosgv)

---

Top Contributors

[![markitosgv](https://avatars.githubusercontent.com/u/1706470?v=4)](https://github.com/markitosgv "markitosgv (9 commits)")

---

Tags

extractorpdfimagesviterbit

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/viterbit-pdfimages-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/viterbit-pdfimages-extractor/health.svg)](https://phpackages.com/packages/viterbit-pdfimages-extractor)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[spatie/image

Manipulate images with an expressive API

1.4k60.7M188](/packages/spatie-image)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[brianmcdo/image-palette

Extracts colors from an image and generates a color palette against a whitelist of colors.

183222.1k2](/packages/brianmcdo-image-palette)[alchemy/phpexiftool

Exiftool driver for PHP

41191.5k4](/packages/alchemy-phpexiftool)[jolicode/media-bundle

A media management bundle for Symfony applications, with Easyadmin and SonataAdmin integrations.

11213.6k](/packages/jolicode-media-bundle)

PHPackages © 2026

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