Last active
May 10, 2019 20:41
-
-
Save bytehead/5917952 to your computer and use it in GitHub Desktop.
imagick pdf to jpg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// read page 1 | |
$im = new imagick( 'test.pdf[ 0]' ); | |
// convert to jpg | |
$im->setImageColorspace(255); | |
$im->setCompression(Imagick::COMPRESSION_JPEG); | |
$im->setCompressionQuality(60); | |
$im->setImageFormat('jpeg'); | |
//resize | |
$im->resizeImage(290, 375, imagick::FILTER_LANCZOS, 1); | |
//write image on server | |
$im->writeImage('thumb.jpg'); | |
$im->clear(); | |
$im->destroy(); |
This doesn't work on latest version of ghostscript. Any help is pretty much appreciated
i uninstalled ghostscript 9.27 and installed 9.26 and got pdf converting to work again.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work on latest version of ghostscript. Any help is pretty much appreciated