I am sure it's something going on in your code and/or iText - but neither are 
things that I am able to look at...

Hopefully, one of the iText guys (Bruno, Paulo, etc.) can comment.

Leonard

From: Danila Galimov [mailto:danila.gali...@exigenservices.com]
Sent: Wednesday, June 09, 2010 12:27 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] pdf with cmyk jpeg image problem

Hello Leonard,

Thank you very much for your reply! Have you got any sample or link how to do 
that you've mentioned?

Just wondering: why does tiff with the same ICC profile work and jpeg does not? 
Maybe I can load the jpeg programmatically, and then convert it internally to 
tiff or raw and copy to PDF with same (old) profile attached?

Danil Galimov
Team Leader
for eBusiness T-mobile UK
Tel: +7 812 457-05-86 ex7504
Cell: +7 911 927-33-64
Fax: +7 812 327-98-65

From: Leonard Rosenthol [mailto:lrose...@adobe.com]
Sent: Wednesday, June 09, 2010 8:11 PM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] pdf with cmyk jpeg image problem

I haven't looked at ANY of the sample files, but I will make one comment.

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.

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.

Leonard

From: Danila Galimov [mailto:danila.gali...@exigenservices.com]
Sent: Wednesday, June 09, 2010 11:01 AM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] pdf with cmyk jpeg image problem

Hello all,

I've got 2 images: original tiff with CMYK Icc profile attached 
(http://bgrh.spb.ru/www/pdfError/House.tiff ), and converted jpeg with same 
CMYK profile attached (http://bgrh.spb.ru/www/pdfError/House.jpg).

Profiles are extracted using PhotoMe freeware program 
(http://www.photome.de/home.html ) and are byte-by-byte the same 
(http://bgrh.spb.ru/www/pdfError/house_tiff.icc  and 
http://bgrh.spb.ru/www/pdfError/house_jpg.icc respectively).

I'm just inserting the image into the pdf file, and for some reason it's not 
working with jpeg with CMYK profile (Adobe Reader shows "Insufficient data for 
an image" message box), but successfully works with same tiff with or without 
profile.

http://bgrh.spb.ru/www/pdfError/test.pdf - not working (from jpeg with profile)
http://bgrh.spb.ru/www/pdfError/test_working.pdf - working (from same jpeg, but 
profile has been removed programmatically, see below)

The code is very simple:

Document document = new Document(PageSize.A3);
PdfWriter writer = PdfWriter.getInstance(document, new 
FileOutputStream(args[1]));

document.open();
try {
                Image image = Image.getInstance(args[0]);
//                image.tagICC(null);
                document.add(image);
} finally {
                document.close();
 }

Jpeg is fully valid (I've used http://hul.harvard.edu/jhove/ to check it and no 
validation errors are found).

I've tried both iText 5.0.1 and 5.0.2, but the result is the same.

Very strange that the same profile is working ok with tiff but not working with 
jpeg format.

This confuses me. Can you please help me? Have you got any ideas? Maybe it's 
just an Adobe Reader error? Do you think it's possible to detect these errors 
on processing stage? Even if it's not possible to fix, I would like to be able 
to detect these errors at processing stage, because I'm inserting thousands of 
images into the pdf, and it will be hard to find not-working one(s).

Thanks in advance!
Danil Galimov
Team Leader
for eBusiness T-mobile UK
Tel: +7 812 457-05-86 ex7504
Cell: +7 911 927-33-64
Fax: +7 812 327-98-65

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