You should complain to the TIFF producer or to JAI. This are all JAI errors.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Raj Sadan [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, November 14, 2002 6:14
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] Problems in TIF to PDF conversion
> 
> Hi,
> 
> Could anyone please help me in this regard. I am trying to convert some of
> the tiff files into PDF and I get the following exceptions.
> 
> java.lang.IllegalArgumentException: Bad endness tag (not 0x4949 or
> 0x4d4d).(For only one *.tif file)
> 
> java.lang.RuntimeException: Decoding of old style JPEG-in-TIFF data is not
> supported.(For a few *.tif files)
> 
> java.lang.error: All fill bits preceding EOL code must be 0.(For a few
> *.tif files)
> 
> This is the code which is converting the tif to PDF:
> 
> File file = new File(filePath+fileName);
> SeekableStream s = new FileSeekableStream(file);
> 
> TIFFDecodeParam param = null;
> 
> ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param);
> 
> int total = dec.getNumPages();
> 
> PdfContentByte cb = writer.getDirectContent();
> 
> for (int k = 0; k < total; ++k) {
>      RenderedImage ri = dec.decodeAsRenderedImage(k);
>      Raster ra = ri.getData();
>      BufferedImage bi = new BufferedImage(ri.getColorModel(),
>      Raster.createWritableRaster(ri.getSampleModel(), ra.getDataBuffer(),
> null), false, new Hashtable());
>      Image img = Image.getInstance(bi, null, true);
>      img.scalePercent(72f / 300f * 100);
>      img.setAbsolutePosition(0, 0);
>      cb.addImage(img);
>      document.newPage();
> }
> 
> Could anyone please tell me what's wrong with the tif formats and what
> type of tif should I use for successful conversion?
> 
> Thanks and Regards,
> Rajesh.S
> 
> 
> 
>   _____  
> 
> Do you Yahoo!?
> Yahoo! Web Hosting
> <http://rd.yahoo.com/hosting/mailsig/*http://webhosting.yahoo.com> - Let
> the expert host your site


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to