iTextSharp exception: PDF header signature not found
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using iTextSharp to read the contents of PDF documents: PdfReader reader = new PdfReader(pdfPath); using (StringWriter output = new StringWriter()) { for (int i = 1; i 99% of the time it works just fine. However, there is this one PDF file that will sometimes throw this exception: PDF header signature not found. StackTrace: at iTextSharp.text.pdf.PRTokeniser.CheckPdfHeader() at iTextSharp.text.pdf.PdfReader.ReadPdf() at iTextSharp.text.pdf.PdfReader..ctor(String filename, Byte[] ownerPassword) at Reader.PDF.DownloadPdf(String url) in C: