iTextSharp IOException "Trailer not found"
.net, c#, itext
Solution
The trailer is a part the structure of a PDF file. If you're getting an error saying it can't be found then the first thing I'd think is your file is corrupt. Being able to open the PDF in a PDF viewer program doesn't necessarily mean the PDF isn't corrupt; I understand that if it's a linearized PDF file the viewer won't attempt to use the trailer.
Does your code throw an IOException for any PDF you attempt to read?
- If so, then maybe using a more recent version of iTextSharp will help or at least post some code.
- If not, then I'd work on recreating the PDFs you're trying to process.
Problem
am using iTextSharp ( .NET 2.0 Vista ). The iTextSharp Version is 4.1.2.0 ``` PdfReader reader = new PdfReader(pdfFile); ``` is causing the library to thrown an exception saying "Trailer not found" The file exists and can be viewed in Adobe no problem Any ideas?