Hello,
I'm having some problem converting this tiff file in pdf.

335D6.tif
<http://itext-general.2136553.n4.nabble.com/file/n4660273/335D6.tif>  

The function TiffImage.GetTiffImage throw me "EndOfStreamException".
I know there are similar questions and maybe the problem is that the tiff
file is somehow corrupted but could you please give me some advice?

GetNumberOfPages function returns the correct number of pages (2)

This is my code:

lv_RandomArray = New iTextSharp.text.pdf.RandomAccessFileOrArray(lp_RasFile)
lv_NumPages = lv_TiffImage.GetNumberOfPages(lv_RandomArray)

lv_PDFDoc = New iTextSharp.text.Document(iTextSharp.text.PageSize.A4)

lv_OutputPdfStream = File.Create(lp_OutFile)

lv_PdfWriter = PdfWriter.GetInstance(lv_PDFDoc, lv_OutputPdfStream)
lv_PdfWriter.StrictImageSequence = True

lv_PDFDoc.Open()

 For lv_Index As Integer = 1 To lv_NumPages
              lv_Image =
iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(lv_RandomArray, lv_Index)
              lv_Image.CompressionLevel = PdfStream.BEST_COMPRESSION
              lv_Image.SetAbsolutePosition(0, 0)
              lv_Image.ScaleAbsolute(lv_PDFDoc.PageSize.Width,
lv_PDFDoc.PageSize.Height)
              lv_PDFDoc.Add(lv_Image)
              lv_PDFDoc.NewPage()
 Next

Thanks in advance for any help!
Stefy







--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/EndOfStreamException-on-TiffImage-GetTiffImage-tp4660273.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to