0
我正在使用iTextSharp.dll來閱讀PDF文件的內容。在Windows服務器上它工作正常,但不在Mono平臺上。用於閱讀PDF文件的iTextSharp在Mono上不起作用
單錯誤:
Server Error in '/' Application
Object reference not set to an instance of an object
我使用這個代碼:
PdfReader reader = new PdfReader(filename);
StringBuilder text = new StringBuilder();
for (int page = 1; page <= reader.NumberOfPages; page++)
{
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
string currentText = PdfTextExtractor.GetTextFromPage(reader, page, strategy);
currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText)));
text.Append(currentText);
reader.Close();
}
iTextSharp使用什麼版本?哪條特定的線路拋出異常? – 2013-03-22 17:01:59