I need to convert pdf to jpeg. So I use next code:
Code: Select all
$im = new Imagick('some.pdf');
$im->setImageColorspace(255);
$im->setCompression(Imagick::COMPRESSION_JPEG);
$im->setCompressionQuality(30);
$im->setImageFormat('jpeg');
$im->writeImage('some.jpg');
$im->clear();
$im->destroy();
I tried some solutions:
1) Add font from pdf to ~/.fonts/
2) Add code:
Code: Select all
$im->setFont('times_new_roman.ttf');
But everything takes no effect.
Hope you can help me find a solution. You're the last hope)
Here you can download zip (rassol.zip) with generated image and pdf