PHPackages                             codeinc/pdf2img-client - 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. codeinc/pdf2img-client

Abandoned → [codeinc/document-cloud-client](/?search=codeinc%2Fdocument-cloud-client)ArchivedLibrary[Image &amp; Media](/categories/media)

codeinc/pdf2img-client
======================

A PHP client for the pdf2img service

v1.10(1y ago)027MITPHPPHP &gt;=8.2

Since Feb 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/codeinchq/pdf2img-php-client)[ Packagist](https://packagist.org/packages/codeinc/pdf2img-client)[ Docs](https://github.com/codeinchq/pdf2img-php-client)[ RSS](/packages/codeinc-pdf2img-client/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (12)Used By (0)

Pdf2Img PHP client
==================

[](#pdf2img-php-client)

[![Code Inc.](https://camo.githubusercontent.com/5ebbb7e6850c1b5df6450f6194e75def43006025cce2c4bc0534363263bf302d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6465253230496e632e2d50646632496d672d626c7565)](https://github.com/codeinchq/pdf2img)[![Tests](https://github.com/codeinchq/pdf2img-php-client/actions/workflows/phpunit.yml/badge.svg)](https://github.com/codeinchq/pdf2img-php-client/actions/workflows/phpunit.yml/badge.svg)

Important

This client is deprecated and is replaced by the [Document Cloud PHP Client](https://github.com/codeinchq/document-cloud-php-client)

This repository contains a PHP 8.2+ library for converting PDF files to images using the [pdf2img](https://github.com/codeinchq/pdf2img) service.

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

[](#installation)

The library is available on [Packagist](https://packagist.org/packages/codeinc/pdf2img-client). The recommended way to install it is via Composer:

```
composer require codeinc/pdf2img-client
```

Usage
-----

[](#usage)

This client requires a running instance of the [pdf2img](https://github.com/codeinchq/pdf2img) service. The service can be run locally [using Docker](https://hub.docker.com/r/codeinchq/pdf2img) or deployed to a server.

Base example:

```
use CodeInc\Pdf2ImgClient\Pdf2ImgClient;
use CodeInc\Pdf2ImgClient\Exception;

$apiBaseUri = 'http://localhost:3000/';
$localPdfPath = '/path/to/local/file.pdf';

try {
    $client = new Pdf2ImgClient($apiBaseUri);

    // convert
    $image = $client->convert(
        $client->createStreamFromFile($localPdfPath)
    );

    // display the image
    header('Content-Type: image/webp');
    echo (string)$image;
}
catch (Exception $e) {
    // handle exception
}
```

With options:

```
use CodeInc\Pdf2ImgClient\Pdf2ImgClient;
use CodeInc\Pdf2ImgClient\ConvertOptions;

$apiBaseUri = 'http://localhost:3000/';
$localPdfPath = '/path/to/local/file.pdf';
$destinationPath = '/path/to/destination/file.jpg';
$convertOption = new ConvertOptions(
    format: 'jpg',
    page: 3,
    density: 300,
    height: 800,
    width: 800,
    background: 'red',
    quality: 90,
);

try {
    $client = new Pdf2ImgClient($apiBaseUri);

    // convert
    $image = $client->convertLocalFile(
        $client->createStreamFromFile($localPdfPath),
        $convertOption
     );

    // saves the image to a file
    $client->saveStreamToFile($image, $destinationPath);
}
catch (Exception $e) {
    // handle exception
}
```

License
-------

[](#license)

The library is published under the MIT license (see [`LICENSE`](LICENSE) file).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

Recently: every ~1 days

Total

11

Last Release

570d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/8f72f949d7f70e400c02c225685f1934dec6219689f25edec38b4037df166d58?d=identicon)[codeinc](/maintainers/codeinc)

---

Top Contributors

[![joanfabregat](https://avatars.githubusercontent.com/u/4227907?v=4)](https://github.com/joanfabregat "joanfabregat (40 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codeinc-pdf2img-client/health.svg)

```
[![Health](https://phpackages.com/badges/codeinc-pdf2img-client/health.svg)](https://phpackages.com/packages/codeinc-pdf2img-client)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M318](/packages/openai-php-client)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[mailgun/mailgun-php

The Mailgun SDK provides methods for all API functions.

1.1k30.8M180](/packages/mailgun-mailgun-php)[deeplcom/deepl-php

Official DeepL API Client Library

2607.3M114](/packages/deeplcom-deepl-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)

PHPackages © 2026

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