{"repo":"spatie/pdf-to-image","free":true,"listed":false,"github":"https://github.com/spatie/pdf-to-image","clone":"git clone https://github.com/spatie/pdf-to-image.git","description":"Convert a pdf to an image","language":"PHP","stars":1455,"topics":["php","pdf","convert","image","imagick","ghostscript"],"license":"MIT","category":"media-processing","readme_excerpt":"Convert a PDF to an image This package provides an easy-to-work-with class to convert a PDF to one or more image. Requirements You should have Imagick and Ghostscript installed. See issues regarding Ghostscript and Imagick Issues for more information. Installation The package can be installed via composer and requires PHP 8.2+: If you are using PHP [!NOTE] $directoryToWhereImagesShouldBeStored must be an existing directory Save all pages to images: Set the Merge Layer Method for Imagick: Set the background color of the output image: Convert a password-protected (encrypted) PDF by passing the password with the password() method: This requires ImageMagick 7. ImageMagick 6 reads the password from an internal struct field that the imagick extension cannot write to, so it silently ignores any password it is given. On ImageMagick 6, password() therefore throws a PasswordNotSupported exception rather than failing later with an unrelated \"Failed to read the file\" error. You can check which behaviour applies to your installation: Ultra-wide PDFs When working with ultra-wide PDFs, you may encounter issues loading PDF files. To resolve this, update your policy.xml Imagick file, using values appropriate for your use case: Issues regarding Ghostscript This package uses Ghostscript through Imagick. For this to work Ghostscripts gs command should be accessible from the PHP process. For the PHP CLI process (e.g. Laravel's asynchronous jobs, commands, etc...) this is usually already the case.","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/pdf-to-image/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}