title: PHP Image Magick images with poor quality when converting them into a PDF
body: <p>My client has an option in its page where he can export a group of files (images and other PFDs) into a new PDF.</p>
  
  <p>For parsing the selected PDFs I am using Image Magick so, I go over each page of the PDF and I create a new image.</p>
  
  <pre><code>        $im = new Imagick($file);
          $im-&gt;setImageFormat('jpg');
          $im-&gt;setCompressionQuality(100);
          $im-&gt;setImageCompressionQuality(100);
  
          $pagesNumber = $im-&gt;getNumberImages();
  
          for ($i = 0; $i &lt; $pagesNumber; $i++) {
              $im-&gt;setIteratorIndex($i);
  
              $imagePath = $tempFolder . '/page-' . $i . '.jpg';
              $this-&gt;tempParsedPdf[] = $imagePath;
  
              $im-&gt;writeImage($imagePath);
          }
  </code></pre>
  
  <p>After creating all the images I render them on an HTML template which is parsed into a PDF using <code>dompdf</code>. When I open the PDF I see that the images created from the selected PDF have a poor quality and the text is blurred.</p>
  
  <p>I do not know if there is any other way or something I am missing for creating the images with a better definition.</p>