You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Scott Tyriver <Sc...@mgic.com> on 2009/12/14 17:24:21 UTC

convertToImage appears to invert colors


I have a pdf document that has a white background with black text. It
appears after I make the call to convertToImage the colors are reversed. A
black background with white text

         pdDocument = PDDocument.load(new ByteArrayInputStream(aContent));
         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"));
             }
             }

Here is the original

(See attached file: verification.pdf)

And the converted

(See attached file: page-8.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.

Re: convertToImage appears to invert colors

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Scott Tyriver wrote:
> Sorry about the double posting. I never saw the first one on any list
> thought it had something to do with the attachments.
> 
> Here is the link to the question I posted on the JIRA forum
> 
> http://forums.atlassian.com/thread.jspa?threadID=39560
Ups, you addressed the forum about JIRA. I'm afraid that's the wrong place. 
Please use the JIRA-based issue manager at apache [1].

BR
Andreas Lehmkühler

[1] https://issues.apache.org/jira/browse/PDFBOX


Re: convertToImage appears to invert colors

Posted by Scott Tyriver <Sc...@mgic.com>.
Sorry about the double posting. I never saw the first one on any list
thought it had something to do with the attachments.

Here is the link to the question I posted on the JIRA forum

http://forums.atlassian.com/thread.jspa?threadID=39560
                                                                                                  
 ________________________________________________________________________________________________ 
                                                                                                  
 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.



|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Andreas Lehmkuehler <an...@lehmi.de>                                                                                                            |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |users@pdfbox.apache.org                                                                                                                           |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |12/14/2009 12:59 PM                                                                                                                               |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: convertToImage appears to invert colors                                                                                                       |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





Hi,

Scott Tyriver wrote:
>
> I have a pdf document that has a white background with black text. It
> appears after I make the call to convertToImage the colors are reversed.
A
> black background with white text
>
>          pdDocument = PDDocument.load(new ByteArrayInputStream
(aContent));
>          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"));
>              }
>              }
>
> Here is the original
>
> (See attached file: verification.pdf)
>
> And the converted
>
> (See attached file: page-8.jpeg)
Your attachents didn't make it due to some restrictions of the mailing
list.
Please file an issue on JIRA [1] and attach both files to it.

Thanks in advance,
Andreas Lehmkühler

P.S.: Please avoid double postings, sooner or later someone will anser to
your
question.

[1] https://issues.apache.org/jira/browse/PDFBOX

>

>
________________________________________________________________________________________________

>

>  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.





Re: convertToImage appears to invert colors

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Scott Tyriver wrote:
> 
> I have a pdf document that has a white background with black text. It
> appears after I make the call to convertToImage the colors are reversed. A
> black background with white text
> 
>          pdDocument = PDDocument.load(new ByteArrayInputStream(aContent));
>          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"));
>              }
>              }
> 
> Here is the original
> 
> (See attached file: verification.pdf)
> 
> And the converted
> 
> (See attached file: page-8.jpeg)
Your attachents didn't make it due to some restrictions of the mailing list. 
Please file an issue on JIRA [1] and attach both files to it.

Thanks in advance,
Andreas Lehmkühler

P.S.: Please avoid double postings, sooner or later someone will anser to your 
question.

[1] https://issues.apache.org/jira/browse/PDFBOX

>                                                                                                   
>  ________________________________________________________________________________________________ 
>                                                                                                   
>  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.