As I suspected it's a broken TIFF file with the strip byte count at
zero. I added a check in iText to look for this, you can get it from the
CVS or see it at
http://itext.cvs.sourceforge.net/itext/src/com/lowagie/text/pdf/codec/Ti
ffImage.java?view=log.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of nesdt
> Sent: Tuesday, April 17, 2007 12:24 PM
> To: [email protected]
> Subject: Re: [iText-questions] Error on pdf from a tiff file
>
>
> Posted.
>
>
> Paulo Soares wrote:
> >
> > Post one of the images.
> >
> > Paulo
> >
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED]
> >> [mailto:[EMAIL PROTECTED] On
> >> Behalf Of nesdt
> >> Sent: Tuesday, April 17, 2007 11:56 AM
> >> To: [email protected]
> >> Subject: Re: [iText-questions] Error on pdf from a tiff file
> >>
> >>
> >> Done, but it seems that all the images are from the same kind
> >> (the exception
> >> raises for all of them), is there something we can do to fix this?
> >>
> >> Thanks.
> >>
> >>
> >> Paulo Soares wrote:
> >> >
> >> > Some image files are broken and iText can't open them (that
> >> doesn't mean
> >> > that some other viewer can't open them). Surround the
> >> > Image.getInstance() with a try/catch.
> >> >
> >> > Paulo
> >> >
> >> >> -----Original Message-----
> >> >> From: [EMAIL PROTECTED]
> >> >> [mailto:[EMAIL PROTECTED] On
> >> >> Behalf Of nesdt
> >> >> Sent: Tuesday, April 17, 2007 11:31 AM
> >> >> To: [email protected]
> >> >> Subject: [iText-questions] Error on pdf from a tiff file
> >> >>
> >> >>
> >> >> Hello,
> >> >>
> >> >> I've a java application which extracts images from a database
> >> >> and creates
> >> >> one pdf for each document, but the applications crashes down
> >> >> when i get the
> >> >> instance of the image:
> >> >>
> >> >> com.lowagie.text.Image img2 =
> >> >> com.lowagie.text.Image.getInstance("out.tif");
> >> >>
> >> >> The exception i get:
> >> >>
> >> >> java.lang.ArrayIndexOutOfBoundsException: 0
> >> >> at
> >> >>
> >>
> com.lowagie.text.pdf.codec.TIFFFaxDecoder.nextLesserThan8Bits(TIFFFax
> >> >> Decoder.java:1414)
> >> >> at
> >> >>
> >>
> com.lowagie.text.pdf.codec.TIFFFaxDecoder.decodeT6(TIFFFaxDecoder.jav
> >> >> a:955)
> >> >> at
> >> >>
> >>
> com.lowagie.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:252)
> >> >>
> >> >> at
> >> >>
> >>
> com.lowagie.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:107)
> >> >>
> >> >> at test.<init>(test.java:180)
> >> >> at Lanzadortest.main(Lanzadortest.java:24)
> >> >> Exception in thread "main" ExceptionConverter:
> >> >> java.io.IOException: The
> >> >> document
> >> >> has no pages.
> >> >> at
> >> >> com.lowagie.text.pdf.PdfPages.writePageTree(PdfPages.java:118)
> >> >> at
> >> com.lowagie.text.pdf.PdfWriter.close(PdfWriter.java:1118)
> >> >> at
> >> >> com.lowagie.text.pdf.PdfDocument.close(PdfDocument.java:805)
> >> >> at com.lowagie.text.Document.close(Unknown Source)
> >> >> at test.<init>(test.java:201)
> >> >> at Lanzadortest.main(Lanzadortest.java:24)
> >> >>
> >> >> I tried out also:
> >> >>
> >> >> RandomAccessFileOrArray param = new
> >> >> RandomAccessFileOrArray("out.tif");
> >> >> com.lowagie.text.Image img = TiffImage.getTiffImage(param, 1);
> >> >>
> >> >> and i have exactly the same error. Any ideas? thanks in advance.
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/