See http://article.gmane.org/gmane.comp.java.lib.itext.general/20430.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Whenham Patrick (Centric) > Sent: Monday, January 23, 2006 3:38 PM > To: [email protected] > Subject: [iText-questions] "Attempted to read past the end of > the stream." - Tiff file > > Hi, > > I am using the following function in vb.net: > > Dim oImage As iTextSharp.text.Image = > iTextSharp.text.Image.GetInstance(sTiffPath) > > which on most of my Tiff images works fine, but on some Tiff > images is generating the following error: > > "Attempted to read past the end of the stream." > > The stack being: > > at > iTextSharp.text.pdf.RandomAccessFileOrArray.ReadFully(Byte[] > b, Int32 off, Int32 len) > at > iTextSharp.text.pdf.codec.TIFFDirectory.Initialize(RandomAcces > sFileOrArray stream) > at > iTextSharp.text.pdf.codec.TIFFDirectory..ctor(RandomAccessFile > OrArray stream, Int32 directory) > at > iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(RandomAccessF > ileOrArray s, Int32 page, Boolean direct) > at > iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(RandomAccessF > ileOrArray s, Int32 page) > at iTextSharp.text.Image.GetInstance(Uri url) > at iTextSharp.text.Image.GetInstance(String filename) > > > These "bad" Tiff files are: Single page, Black & White, CCITT > Group 4 (2d) Fax compression, Most significant to least fill > order, 300x300 dpi, A4 size, and produced by a Xerox > Documentum Center scanner. > > Running the following code works but is not very clean, and I > would prefer to avoid: > > Dim oBitmap As New Bitmap(sTiffPath) > oBitmap.Save(sTiffPath & ".tif") > oImage = iTextSharp.text.Image.GetInstance(sTiffPath & ".tif") > > Do you have any Idea how I can identify & fix what, in the > Tiff file, is generating this error ? > > Thanks, > Patrick > > Patrick WHENHAM (CENTRIC) > UCB Pharma - IT > Global Drug Development IT Applications > S6 - 1.04.D > T: +32.2.386 3198 > > > > > --------------------------------------------------------- > > Legal Notice: This electronic mail and its attachments are > intended solely for the person(s) to whom they are addressed > and contain information which is confidential or otherwise > protected from disclosure, except for the purpose for which > they are intended. Dissemination, distribution, or > reproduction by anyone other than the intended recipients is > prohibited and may be illegal. If you are not an intended > recipient, please immediately inform the sender and return > the electronic mail and its attachments and destroy any > copies which may be in your possession. UCB screens > electronic mails for viruses but does not warrant that this > electronic mail is free of any viruses. UCB accepts no > liability for any damage caused by any virus transmitted by > this electronic mail. > > --------------------------------------------------------- > > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
