The problem isn't color, it appears that you are downsampling the resolution
and thus losing image data.
Leonard
From: Craig Edwards <[email protected]<mailto:[email protected]>>
Reply-To: Post here
<[email protected]<mailto:[email protected]>>
Date: Mon, 16 Jan 2012 15:00:30 -0800
To: Post here
<[email protected]<mailto:[email protected]>>
Subject: Re: [iText-questions] Washed out (transparent) image
Thanks for the reply. I should have mentioned that I had previously tried that
and it doesn’t appear to make any difference. For reference, I’ve attached
what it looks like when calling with rgbTransparencyBlending=true.
Any other thoughts would be much appreciated. Thanks a lot.
Craig
From: Paulo Soares [mailto:[email protected]]
Sent: Monday, 16 January 2012 9:17 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Washed out (transparent) image
Call:
PdfWriter.setRgbTransparencyBlending(true);
Paulo
________________________________
From: Craig Edwards [mailto:[email protected]]
Sent: Monday, January 16, 2012 3:46 AM
To:
[email protected]<mailto:[email protected]>
Subject: [iText-questions] Washed out (transparent) image
Hello fellow iTexters…
One the images that I am embedding in my PDF appears washed out in the final
output. The simplest test case is as follows:
Document doc = new Document(PageSize.A4);
PdfWriter.getInstance(doc, new FileOutputStream(new
File("washout.pdf")));
doc.open();
doc.add(Image.getInstance("checkpoints.png"));
doc.close();
The image appears in the PDF, but the colours are not the same as if you just
view the image directly. Note that I normally scale the image so that it fits
on the page, but I wanted to make the test case as simple as possible (you can
see the problem both with and without scaling).
I've attached the image and the resulting PDF, and they are also downloadable
from the following URLs in case they don't make it through:
http://dl.dropbox.com/u/48589982/checkpoints.png
http://dl.dropbox.com/u/48589982/washout.pdf
My initial googling suggests that I may need to set the color space, but I am
not 100% sure if a) that is really the problem and b) exactly what the sequence
of iText APIs I need to call if it is. Any thoughts/advice would be most
welcome. Thanks a lot.
Craig
This email message and any accompanying attachments may contain information
that is confidential and is subject to legal privilege. If you are not the
intended recipient, do not read, use, disseminate, distribute or copy this
message or attachments. If you have received this message in error, please
notify the sender immediately and delete this message. Any views expressed in
this message are those of the individual sender, except where the sender
expressly, and with authority, states them to be the views of AMP. Before
opening any attachments, please check them for viruses and defects.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php