|
| 1 | +# PDF TO IMAGE |
| 2 | + |
| 3 | +[](https://github.com/gunantos/pdftoimage-php/actions/workflows/php.yml) |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +<br> |
| 8 | +<a href="https://sponsor.app-kita.net" target="_blank"><img src="https://img.shields.io/github/sponsors/gunantos?logo=gunantos&style=for-the-badge" title="Pay Coffe" /></a><br> |
| 9 | +Pdf to image library using Imagick<br> |
| 10 | + |
| 11 | +### INSTALATION |
| 12 | + |
| 13 | +- Imagick |
| 14 | + |
| 15 | + 1. Check PHP Version `php -i|find "PHP Version"` |
| 16 | + 2. Check PHP is Thread Safety `php -i|find "Thread Safety"` |
| 17 | + 3. Check PHP Architecture `php -i|find "Architecture"` |
| 18 | + 4. Download imagick from [Imagick](https://pecl.php.net/package/imagick) |
| 19 | + 5. Once you downloaded the correct files: |
| 20 | + |
| 21 | + - Extract from `php_imagick-….zip` the `php_imagick.dll `file, and save it to the ext directory of your PHP installation |
| 22 | + - Extract from `ImageMagick-….zip` the DLL files located in the bin folder that start with `CORE_RL` or `IM_MOD_RL`, and save them to the PHP root directory `(where you have php.exe)`, or to a directory in your PATH variable |
| 23 | + - Add this line to your `php.ini` file: `extension=php_imagick.dll` |
| 24 | + - Restart the Apache/NGINX Windows service (if applicable) |
| 25 | + |
| 26 | + 6. To test if the extension works, you can run this PHP code: |
| 27 | + |
| 28 | + ```php |
| 29 | + <?php |
| 30 | + $image = new Imagick(); |
| 31 | + $image->newImage(1, 1, new ImagickPixel('#ffffff')); |
| 32 | + $image->setImageFormat('png'); |
| 33 | + $pngData = $image->getImagesBlob(); |
| 34 | + echo strpos($pngData, "\x89PNG\r\n\x1a\n") === 0 ? 'Ok' : 'Failed'; |
| 35 | + ``` |
| 36 | + |
| 37 | +- Library |
| 38 | + `composer install appkita/pdftoimage` |
| 39 | + |
| 40 | +### Lear More |
| 41 | + |
| 42 | +- [php](https://www.php.net/manual/en) |
| 43 | +- [Imagick](https://www.php.net/manual/en/book.imagick.php) |
| 44 | + |
| 45 | +### Chat |
| 46 | + |
| 47 | +[Discord](https://discord.gg/bXUWCSaw) |
| 48 | + |
| 49 | +### Sponsor |
| 50 | + |
| 51 | +[Pay Coffe](https://sponsor.app-kita.net) |
0 commit comments