>The problem is that you have a RGB jpeg with a CMYK profile. Apparently the 
>tool you used to convert the tiff >to jpeg also converted the CMYK image to 
>RGB.

Well, if this is not allowed, maybe iText should throw an exception on writing 
if someone is trying to do that? 
 
Paulo
----- Original Message ----- 
From: Danila Galimov 
To: Post all your questions about iText here 
Sent: Thursday, June 10, 2010 10:30 AM
Subject: Re: [iText-questions] pdf with cmyk jpeg image problem


>Embedded profiles inside of image data are _NOT_ recognized by the PDF format 
>and thus by conforming >readers. If you wish to tag the images with the 
>profile (which is a good thing!), then you need to be sure >that you are 
>constructing them in ICCBased colorspace inside the PDF with the profile 
>properly extracted from >the image and applied to the PDF.

As I can see in the code, iText does that for all images, which are tagged with 
profile (code from com.itextpdf.text.pdf.PdfWriter:

                if (image.hasICCProfile()) {
                    PdfICCBased icc = new PdfICCBased(image.getICCProfile(), 
image.getCompressionLevel());
                    PdfIndirectReference iccRef = add(icc);
                    PdfArray iccArray = new PdfArray();
                    iccArray.add(PdfName.ICCBASED);
                    iccArray.add(iccRef);
                    PdfArray colorspace = i.getAsArray(PdfName.COLORSPACE);
                    if (colorspace != null) {
                        if (colorspace.size() > 1 && 
PdfName.INDEXED.equals(colorspace.getPdfObject(0)))
                            colorspace.set(1, iccArray);
                        else
                            i.put(PdfName.COLORSPACE, iccArray);
                    }
                    else
                        i.put(PdfName.COLORSPACE, iccArray);
                }
)


>I will also note that CMYK-based JPEGs have to special cased in PDF - they 
>can't be simply copied over as >other RGB JPEGs can.

What should be performed in this case? What does Acrobat Pro do when you're 
trying to insert jpeg image with CMYK profile into the pdf?

Best wishes, Danila Galimov

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/=

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to