开发者

iTextSharp IOException "Trailer not found"

am using iTextSharp ( .NET开发者_如何学JAVA 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?


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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜