Open Source libraries for PDF to image conversion [duplicate]

拈花ヽ惹草 提交于 2019-12-08 08:01:51

问题


Possible Duplicate:
Export PDF pages to a series of images in Java

Please suggest some good java libraries which can be used for a PDF file to image conversion. I tried using PDFBox: http://pdfbox.apache.org/ 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.

Following is the code snippet I used for the same:

PDDocument document = null;  
document = PDDocument.load( pdfFile );  
List  pages = document.getDocumentCatalog().getAllPages();  
for( int i=startPage-1; i<endPage && i<pages.size(); i++ )  
{  
  try  
  {  
    PDPage page = (PDPage)pages.get( i );  
    BufferedImage  image = page.convertToImage();  
  }  
}  
document.close(); 

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.

Please suggest any other alternatives as well.

I have tried using jPedal: http://www.jpedal.org/ which works out fine but its not free so please suggest about all good alternatives on this.


回答1:


Try icePDF



来源:https://stackoverflow.com/questions/5471264/open-source-libraries-for-pdf-to-image-conversion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!