You have answered your own question, you need to get the
PNG fixed first.

-Bill Ensley
www.bearprinting.com

On 5/25/2012 12:53 PM, newbie2itext wrote:
> Thanks for the reply.
>
> So what I'm doing is
> 1. use PdfStamper to read an existing pdf and add some formfields onto it
> 2. use PdfStamper to fill out the formfields in BaseColor.Blue, add a PNG
> image on the first page and flatten the document.
>
> All went well except the text I filled in the page with PNG image will be
> darker than other pages due to the color space issue.(see attached sample)
> http://itext-general.2136553.n4.nabble.com/file/n4654689/example.pdf
> example.pdf
>
> I don't think it's an issue cause by iText because it happens too when I
> copy-paste an PNG image in Acrobat.
>
> I tried to manually change the color space right after I instanciate the
> PdfStamper but it's not working, the text is still darker:
> ---------------------------------------
>
>                  PdfReader r = null;
>                  PdfStamper ps = null;
>                  FileStream outstream = null;
>
>                  // read existing PDF document
>                  r = new PdfReader(
>                    new RandomAccessFileOrArray(this.inputFileName), null);
>
>                  outstream = File.Create(this.outputFileName);
>                  ps = new PdfStamper(r, outstream);
>
>                  PdfDictionary pp = new PdfDictionary();
>                  pp.Put(PdfName.TYPE, PdfName.GROUP);
>                  pp.Put(PdfName.S, PdfName.TRANSPARENCY);
>                  pp.Put(PdfName.CS, PdfName.DEVICERGB);
>
>                  PdfContentByte cb = ps.GetOverContent(1);
>                  cb.PdfWriter.Group = pp;
>                  cb.SetDefaultColorspace(PdfName.CS, PdfName.DEVICERGB);
>
>                  //...create textfield
>                  //...fill out textfield
>                  //...add PNG image
>
>                  ps.FormFlattening = true;
>
>                  ps.Close();
>
>
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/text-color-changes-when-adding-PNG-image-tp4653811p4654689.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> 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

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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

Reply via email to