title: Open Source libraries for PDF to image conversion
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/550129/export-pdf-pages-to-a-series-of-images-in-java">Export PDF pages to a series of images in Java</a>  </p>
  </blockquote>
  
  
  
  <p>Please suggest some good java libraries which can be used for a PDF file to image conversion.
  I tried using PDFBox: <a href="http://pdfbox.apache.org/" rel="nofollow noreferrer">http://pdfbox.apache.org/</a> but after conversion to image most of my text from the pdf file was garbled in the image. It read a 'T' as a 'Y' a 'C' as a '#' and so on.</p>
  
  <p>Following is the code snippet I used for the same:</p>
  
  <pre><code>PDDocument document = null;  
  document = PDDocument.load( pdfFile );  
  List  pages = document.getDocumentCatalog().getAllPages();  
  for( int i=startPage-1; i&lt;endPage &amp;&amp; i&lt;pages.size(); i++ )  
  {  
    try  
    {  
      PDPage page = (PDPage)pages.get( i );  
      BufferedImage  image = page.convertToImage();  
    }  
  }  
  document.close(); 
  </code></pre>
  
  <p>I guess it is some issue that they have with rendering fonts.
  In case u think I might have missed something out while using PDFBox please let me know.</p>
  
  <p>Please suggest any other alternatives as well.</p>
  
  <p>I have tried using jPedal: <a href="http://www.jpedal.org/" rel="nofollow noreferrer">http://www.jpedal.org/</a> which works out fine but its not free so please suggest about all good alternatives on this.</p>