The exception you mentioned was caused by a truncated tiff. iText is not a tiff fixing library.
Paulo ----- Original Message ----- From: "SAK" <[EMAIL PROTECTED]> To: "Post all your questions about iText here" <itext-questions@lists.sourceforge.net> Sent: Saturday, March 03, 2007 5:47 PM Subject: Re: [iText-questions] EOF exception being thrown Hi Paulo, I am getting the same exception as mentioned in the following thread ... ( I am using the Tiff2Pdf example from itext website and tried different version ( itext-1.4.8 and itext-2.0.0 ) However when I use the (Tiff2pdf )example with itext-1.3.1.jar it works fine. I do want to go back to itext-1.3.1.jar Could you please let me know if there is any fix for this issue ? It is really critical for me. Thanks for you help. --------- ExceptionConverter: java.io.EOFException at com.lowagie.text.pdf.RandomAccessFileOrArray.readFully(RandomAccessFileOrArray.java:222) at com.lowagie.text.pdf.codec.TIFFDirectory.initialize(TIFFDirectory.java:261) at com.lowagie.text.pdf.codec.TIFFDirectory.<init>(TIFFDirectory.java:141) at com.lowagie.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:122) at com.lowagie.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:107) Paulo Soares <[EMAIL PROTECTED]> wrote: You can send me the tiff. Paulo > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Q Bert > Sent: Friday, February 09, 2007 3:36 AM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] EOF exception being thrown > > In trying to retrieve an image using the > TiffImage.getTiffImage() method, I'm recieving an EOF > exception. In looking into this issue through the source > code, i'm seeing that the size of the byte array of the file > is 1000046, and it appears the "length" returned by the > TIFFTAG_STRIPBYTECOUNTS tag(TiffDirectory line 303, tag > number 279 in the TiffConstants) is returning 1234899 which > is greater than the size of the file. I also noticed that an > image viewer on my computer is able to render it. Any clue on > a quick fix to allow this? even if i have to add it here and > recompile the source? I have a customer that would like to > not have to re-image all the documents throwing this error on > their system. > > Let me know if you would like the tif and how to get it to you. > > Thanks! > > error is below: > > ExceptionConverter: java.io.EOFException > at > com.lowagie.text.pdf.RandomAccessFileOrArray.readFully(RandomA > ccessFileOrArray.java:234) > at > com.lowagie.text.pdf.RandomAccessFileOrArray.readFully(RandomA > ccessFileOrArray.java:221) > at > com.lowagie.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:243) > at trimin.test.testLowagie.main(testLowagie.java :33) > > here is the java test code i used to try and debug this: > > public class testLowagie { > > public static void main(String[] args) { > try { > String fileName = "C:/IMG46461.tif"; > int numPages = 0; > File file = new File(fileName); > > RandomAccessFileOrArray ra = new > RandomAccessFileOrArray(fileName); > ra.seek(0); > numPages = TiffImage.getNumberOfPages(ra); > System.out.println("number of bytes in file: " + ra.length()); > Image img = TiffImage.getTiffImage(ra, 1,false); > System.out.println("image retrieved"); > } catch(Exception e) { > System.out.println("Problem getting image: " + > e.getMessage()); > e.printStackTrace(); > } > } > } > > > ________________________________ > > Live Search: Better results, fast Try it now! > > 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. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ --------------------------------- It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. -------------------------------------------------------------------------------- > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV -------------------------------------------------------------------------------- > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions > Buy the iText book: http://itext.ugent.be/itext-in-action/ > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/