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(RandomAccessFileOrArray.java:234)
     at 
com.lowagie.text.pdf.RandomAccessFileOrArray.readFully(RandomAccessFileOrArray.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
http://get.live.com/search/overview
-------------------------------------------------------------------------
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/

Reply via email to