I use Imagick to convert pdf to JPG. The problem is that pdf is in CMYK format and the colors from resulting jpg is slightly different from those from pdf. I use the following code to achieve the result:
$filelist = array("D3807797-8425-5-1_40.pdf[2]","D3807797-8425-5-1_40.pdf[3]");
$all = new Imagick();
foreach($filelist as $file){
$im = new Imagick($file);
$all->addImage($im);
}
$all->resetIterator();
$combined = $all->appendImages(true);
$combined->setImageFormat("jpg");
$combined->writeImage("test.jpg");
I also tried a linux command for this
$cmd = "gm convert -density 150x150 {$pdf}[2] {$pdf}[3] -append -quality 100 {$image}";
exec($cmd)
And i get the same result.
Could somebody help me with this problem? Thanks in advance.