pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Tyriver <Scott_Tyri...@mgic.com>
Subject convertToIamge
Date Wed, 09 Dec 2009 17:12:18 GMT


I am calling convertToImage to return a buffered image. The image that I am
getting back has a black background and white text which is the inverse of
the orignal.

Here are the two documents.

Original

(See attached file: verification.pdf)

Converted

(See attached file: page-8.jpeg)

Here is the code

         pdDocument = PDDocument.load(new ByteArrayInputStream(aContent));
         numberOfPages = pdDocument.getNumberOfPages();
         aProcessingContextLog.setPageCount(numberOfPages);
         List<PDPage> documentPageList = pdDocument.getDocumentCatalog
().getAllPages();

          for(int i=0; i<documentPageList.size(); ++i){
             PDPage aPage = documentPageList.get(i);
             for (int x=1; x < 14; x++) {
               BufferedImage tempImage = convertToImage(x, (2 * 72),aPage);
               ImageIO.write(tempImage,"jpeg", new File("c:\\tmp\\page-" +
x + ".jpeg"));
            }
                                                                                         
        
 ________________________________________________________________________________________________

                                                                                         
        
 Scott Tyriver § Systems Development § Mortgage Guaranty Insurance Corporation         
          
 250 East Kilbourn Avenue § Milwaukee WI 53202 § ( 414.347.6803 § 7 414.347.6710 § * 
            
 scott_tyriver@mgic.com                                                                  
        
                                                                                         
        




This message is intended for use only by the person(s) addressed above and
may contain privileged and confidential information. Disclosure or use of
this message by any other person is strictly prohibited. If this message is
received in error, please notify the sender immediately and delete this
message.
Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message