PHPackages                             hyder/converter - 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. hyder/converter

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

hyder/converter
===============

A Laravel package that provides an easy-to-use interface to convert PDF files to images using the Imagick PHP extension.

1.0.1(3y ago)228MITPHPPHP ^7.3|^8.0

Since Apr 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/abhihyder/converter)[ Packagist](https://packagist.org/packages/hyder/converter)[ RSS](/packages/hyder-converter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

About Converter
---------------

[](#about-converter)

A Laravel package that allows you to convert PDF files to images. The package uses Imagick PHP extension and GhostScript to convert PDF files to images.

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

[](#requirements)

- PHP "^7.3|^8.0"
- Imagick PHP extension
    Enable the Imagick extension in your php.ini file by uncommenting or adding the following line:

```
extension=imagick

```

- Ghostscript
    Verify that Ghostscript is installed by running the following command:

```
gs -v
```

This should display the version number of Ghostscript.

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

[](#installation)

You can install the package via composer:

```
composer require hyder/converter
```

Configuration
-------------

[](#configuration)

You can publish the configuration file to customize the package settings. To publish the configuration file, run the following command:

```
php artisan vendor:publish --provider="Hyder\Converter\ConverterServiceProvider" --tag="config"
```

This will create a config/converter.php file where you can configure the package settings.

Optional
--------

[](#optional)

The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

```
'providers' => [
    // ...
    Hyder\Converter\ConverterServiceProvider::class,
];
```

Usage
-----

[](#usage)

Here's an example of how to convert a PDF file to an image:

```
use Hyder\Converter\Facades\PdfToImage;

// Minimalistic
$response = PdfToImage::path('/path/to/file.pdf')
    ->save();

// Customize output
$response = PdfToImage::path('/path/to/file.pdf')
    ->format('png')
    ->resolution(200)
    ->maxLimit(5)
    ->setPage('1-3,5')
    ->toDir('/path/to/directory')
    ->save('output-image-name');
```

Available Methods
-----------------

[](#available-methods)

Here are the available methods of the package:

### path(string $path)

[](#pathstring-path)

This method sets the path of the PDF file you want to convert to an image.

### format(string $format)

[](#formatstring-format)

This method sets the output format of the image. The supported formats are JPEG, JPG, and PNG.

### resolution(int $dpi)

[](#resolutionint-dpi)

This method sets the resolution of the output image in dots per inch (dpi). The higher the resolution, the better the quality of the image, but also the larger the file size.

### maxLimit(int $max)

[](#maxlimitint-max)

This method sets a maximum limit for the number of pages to be converted. If the PDF file has more pages than this limit, only the first $max pages will be converted.

### setPage($pages)

[](#setpagepages)

This method sets the pages of the PDF file that you want to convert. The pages can be specified as single page numbers (e.g. 1,2,3), a range of pages (e.g. 1-3), or a combination of both (e.g. 1,2,3-5). By default only the first page will be converted.

### allPage()

[](#allpage)

This method is used to set all pages of the PDF file for conversion to images. It doesn't make any sense to use maxLimit() or setPage() when using allPage(). If you call these methods before allPage(), they will be ignored.

### toDir(string $storageTo)

[](#todirstring-storageto)

This method sets the directory where the converted images will be saved. If no directory is specified, the default directory will be used.

### save(string $name = "")

[](#savestring-name--)

This method converts the PDF file to an image and saves it to the specified directory. If no name is specified, the image will be saved with a random name.

Error Handling
--------------

[](#error-handling)

After enabling imagick you may get an error in the live server. ImageMagick has some security policies disabling some rights for security reasons. You will have to edit a config file to re-enable the action you need.

Open /etc/ImageMagick-6/policy.xml with your favorite text editor, find the line and replace "none" by "read|write"

### Open the file

[](#open-the-file)

```
sudo nano /etc/ImageMagick-6/policy.xml
```

### Find and edit the line

[](#find-and-edit-the-line)

```

```

### To

[](#to)

```

```

You can [check Here](https://askubuntu.com/questions/1127260/imagemagick-convert-not-allowed#:~:text=ImageMagick%20has%20some,write%22%20pattern%3D%22PDF%22%20/%3E) for better understanding.

Credits
-------

[](#credits)

Imagick

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

[](#contributing)

If you would like to contribute to this package, please create a pull request or open an issue.

License
-------

[](#license)

The PDF to Image Converter package is open-source software licensed under the MIT license.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

2

Last Release

1134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7fb98d8b7606987af9dc221ddb38c6031b28c6d60257d028f2117072e298b103?d=identicon)[abhihyder](/maintainers/abhihyder)

---

Top Contributors

[![abhihyder](https://avatars.githubusercontent.com/u/55033824?v=4)](https://github.com/abhihyder "abhihyder (11 commits)")

---

Tags

laravelpdfimageconverterpdf-to-imagehyderimage-to-pdf

### Embed Badge

![Health badge](/badges/hyder-converter/health.svg)

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

###  Alternatives

[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[spatie/pdf-to-image

Convert a pdf to an image

1.4k15.2M64](/packages/spatie-pdf-to-image)[karkowg/php-mupdf

Minimal PDF to image converter using MuPDF

202.8k](/packages/karkowg-php-mupdf)

PHPackages © 2026

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