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