title: Lossless rotation of PDF files with imagemagick
body: <p>I want to rotate a 351K PDF named <code>08-file.pdf</code> using CLI tools. I've tried <a href="http://www.imagemagick.org/script/index.php" rel="noreferrer">imagemagick</a>:</p>
  
  <pre><code>convert 08-file.pdf -rotate 90 08-file-rotated.pdf
  </code></pre>
  
  <p>But the original quality:</p>
  
  <p><a href="https://i.stack.imgur.com/A7rWZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/A7rWZ.png" alt="enter image description here"></a></p>
  
  <p>Suffered serious degradation:</p>
  
  <p><a href="https://i.stack.imgur.com/vBRdy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vBRdy.png" alt="enter image description here"></a></p>
  
  <p><a href="http://www.imagemagick.org/discourse-server/viewtopic.php?t=8971" rel="noreferrer">I've tried adding the <code>-density 300x300</code> argument</a>, but the outcome was a 2.5M file, nearly one order of magnitude larger than the original, which is a huge waste.</p>
  
  <p><strong>Any idea how to losslessly rotate a PDF file using imagemagick?</strong></p>