Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baraja-core/php-pdf-to-image
Convert PDF to JPG, PNG or GIF in PHP.
https://github.com/baraja-core/php-pdf-to-image
gif jpg pdf php
Last synced: about 21 hours ago
JSON representation
Convert PDF to JPG, PNG or GIF in PHP.
- Host: GitHub
- URL: https://github.com/baraja-core/php-pdf-to-image
- Owner: baraja-core
- License: mit
- Created: 2019-11-12T10:31:20.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-27T09:56:41.000Z (about 1 month ago)
- Last Synced: 2024-12-21T14:42:24.032Z (12 days ago)
- Topics: gif, jpg, pdf, php
- Language: PHP
- Size: 33.2 KB
- Stars: 20
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PDF to image convertor
======================Convert PDF to image and save to disk. Convert PDF to JPG, PNG or GIF in PHP.
📦 Installation
---------------It's best to use [Composer](https://getcomposer.org) for installation, and you can also find the package on
[Packagist](https://packagist.org/packages/baraja-core/php-pdf-to-image) and
[GitHub](https://github.com/baraja-core/php-pdf-to-image).To install, simply use the command:
```shell
$ composer require baraja-core/php-pdf-to-image
```You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.
How to use
----------```php
$configuration = new Configuration(
pdfPath: __DIR__ . '/example.pdf',
savePath: __DIR__ . '/example.jpg',
format: 'jpg'
);// Render PDF to image and save to disk.
\Baraja\PdfToImage\Convertor::convert($configuration);
```Supported configuration options
-------------------------------| Name | Type | Default value |
|------------|---------------|---------------|
| `pdfPath` | `string` | |
| `savePath` | `string` | |
| `format` | `string` | `'jpg'` |
| `trim` | `bool` | `false` |
| `cols` | `int`, `null` | `null` |
| `rows` | `int`, `null` | `null` |
| `bestfit` | `bool` | `false` |📄 License
-----------`baraja-core/php-pdf-to-image` is licensed under the MIT license. See the [LICENSE](https://github.com/baraja-core/template/blob/master/LICENSE) file for more details.