title: Bad image quality converted from PDF file (PHP + Imagick)
body: <p><strong>My code:</strong></p>
  
  <pre><code>$pdf = $this-&gt;name;
  $saveAsPath = $this-&gt;path;
  
  $img = new \Imagick($pdf);
  $img-&gt;setResolution(300, 300);
  $num_pages = $img-&gt;getNumberImages();
  $img-&gt;setImageCompressionQuality(100);
  
  for ($i = 0; $i &lt; $num_pages; $i++) {
      $img-&gt;setIteratorIndex($i);
      $img-&gt;setImageFormat('jpeg');
      $img-&gt;writeImage($saveAsPath . '/' . $i.'.jpg');
  }
  
  $img-&gt;destroy();
  </code></pre>
  
  <p><strong>Results:</strong></p>
  
  <p><strong>Original file:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/LBdAA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LBdAA.png" alt="enter image description here"></a></p>
  
  <p><strong>After Imagick:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/856Pn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/856Pn.png" alt="enter image description here"></a></p>
  
  <p>As we can see lines and letters are worse. How can I improve the quality?</p>