1

I need to convert all PDFs file of a directory into jpgs.

Like:

1.pdf 2.pdf 3.pdf

into

1.jpg 2.jpg 3.jpg

With this script I can find all PDFs.

$dir_name = "";
$pdfs = glob($dir_name."*.pdf");
foreach($pdfs as $pdf) {
   echo $pdf;
}

But how can I convert multiple files?

$imagick = new Imagick();
$imagick->setResolution(300, 300);
$imagick->readImage('???');
$imagick->writeImages('???', false);

  • 1
    Does this answer your question? [Convert PDF to JPEG with PHP and ImageMagick](https://stackoverflow.com/questions/9227014/convert-pdf-to-jpeg-with-php-and-imagemagick) – Syscall Jan 22 '22 at 15:11

0 Answers0