简体   繁体   中英

Convert PDF to TIFF, convert from ImageMagick

I need help to convert a PDF file to TIFF file, I do this with PHP and ImageMagick from Linux, like this

exec('convert -density 110 * -compress LZW out.tiff');

But this sometimes fail, so I need to know the best way to convert a PDF to a TIFF, without lost quality, or if someone knows a better way to do this.

Thanks.

Try Ghostscript , here you have an example.

<?php

$outputTiff = "/var/www/html/document.tiff";
$inputPDF = "/var/www/html/document.pdf";

//Execute the ghost script that takes the PDF as an input and saves it as tiff.
$response = exec("gs -SDEVICE=tiffg4 -r600x600 -sPAPERSIZE=letter -sOutputFile=$outputTiff -dNOPAUSE -dBATCH  $inputPDF");

?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM