pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vanja K." <va...@storagemadeeasy.com>
Subject convert pdf page to image problem
Date Wed, 25 Mar 2015 08:56:38 GMT



I   use  pdfbox  1.8.8  to  convert  pdf  pages  to  image,  i see  
such  problem  for  page  1   of  attached  file (all  other my  files  
are  working  ok)

/Mar 20, 2015 4:31:22 PM org.apache.pdfbox.util.PDFStreamEngine 
processOperator//
//INFO: unsupported/disabled operation: i//
//
/and  saved  images  are   blank  (actually only  black  line is  
shown),  is  any  way  to  fix  this   problem  for  attached file?



this  is  my   function  i  use (nothing  special)



private void _pageDebug(PDDocument document, int page) throws 
IOException, IllegalArgumentException, PrinterException {

         PDPageable pdfInfo = new PDPageable(document);

         // convert page to image
         PDPage pdfPage = (PDPage) 
document.getDocumentCatalog().getAllPages().get(page - 1);

         BufferedImage imagePage = pdfPage.convertToImage();

         File outputfile = new File("c:/data/originalimage" + page + 
".png");
         ImageIO.write(imagePage, "png", outputfile);


}

private PDDocument loadDocument(String src) throws IOException {
         PDDocument document = null;
         try {

             document = PDDocument.load(src);


         } catch (IOException ex) {
             RandomAccessFile scratchFile = new RandomAccessFile(new 
File(src + "2"), "rw");
             document = PDDocument.loadNonSeq(new File(src), scratchFile);
         }
         return document;
     }


PDDocument     document = loadDocument(src);
this._pageDebug(document,  page);

-- 
Thank You,
vanja K.




Mime
View raw message