You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Hue Wai Kee (JIRA)" <ji...@apache.org> on 2014/09/20 03:20:35 UTC

[jira] [Created] (PDFBOX-2369) how to convert pdf to image

Hue Wai Kee created PDFBOX-2369:
-----------------------------------

             Summary: how to convert pdf to image
                 Key: PDFBOX-2369
                 URL: https://issues.apache.org/jira/browse/PDFBOX-2369
             Project: PDFBox
          Issue Type: Test
            Reporter: Hue Wai Kee
             Fix For: 2.0.0


I may i know how to convert pdf to image using pdfbox 2.0.0 ?

List<PDPage> kids = PDDocument.load(fullPath).getDocumentCatalog().getPages().getKids();
		      int count=1;
		      
		      for(PDPage page : kids) {   ///// iterate
		           BufferedImage img = page.convertToImage(BufferedImage.TYPE_INT_RGB,128);
		           File imageFile = new File( filePath + File.separator + FilenameUtils.getBaseName(filename) + File.separator + FilenameUtils.getBaseName(filename) + "_" + count++ + ".jpg" );
		           imageFile.mkdirs();
		           ImageIO.write(img, "jpg",imageFile);
		           }

i using pdfbox-2.0.0-20140919.220435-569
The method convertToImage(int, int) is undefined for the type PDPage. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)