iTextSharp的IOException异常"未发现拖车"拖车、异常、发现、iTextSharp

2023-09-03 04:09:58 作者:爱一个人有多难

我使用iTextSharp的(.NET 2.0 Vista的)。该iTextSharp的版本是4.1.2.0

am using iTextSharp ( .NET 2.0 Vista ). The iTextSharp Version is 4.1.2.0

PdfReader reader = new PdfReader(pdfFile); 

是图书馆导致抛出一个异常说 预告片没有发现   该文件存在,可以在Adobe被视为没有问题 任何想法?

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?

推荐答案

该拖车的一部分的PDF文件的结构。如果你得到一个错误说,它不能被发现,那么我想的第一件事是你的文件已损坏。如果能够打开PDF在PDF查看器程序并不一定意味着该PDF未损坏;我明白,如果它是一个线性的PDF文件查看器将不会尝试使用拖车。

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.

请问您code抛出IOException你尝试读取任何PDF?

Does your code throw an IOException for any PDF you attempt to read?

如果是这样,那么也许使用更近 版本iTextSharp的,将有助于或至少张贴一些code。 如果没有,那么我会工作,重建 PDF文件你想的过程。 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.