【问题标题】:PDFParser error messagePDFParser 错误信息
【发布时间】:2013-05-06 10:38:58
【问题描述】:

错误 1

'org.pdfbox.pdfparser.PDFParser.PDFParser(java.io.InputStream)' 的最佳重载方法匹配有一些无效参数 H:\pdf_ver3.cs 129 51 PDF-to-Text 转换器

代码:

PDFParser pdfParser = new PDFParser();
pdfParser.ExtractText(path, newpath);

【问题讨论】:

  • PDFParser pdfParser = new PDFParser(); pdfParser.ExtractText(path, newpath);
  • 您正在使用 PDFBox。为什么将其标记为与 iTextSharp 相关?此外,错误看起来像 Java-ish(引用 java.io.InputStream),而不是 C#-ish
  • 是的,我使用 PDFBox 作为参考
  • 但是您的错误消息既不是与 iTextSharp 相关的(它明确引用 org.pdfbox.pdfparser.PDFParser.PDFParser,因此显然与 PDFBox 相关)也不是您的代码行(在 iTextSharp 中没有名为 PDFParser 的类)。
  • 我在我的代码中使用了 org.pdfbox.pdfparser;

标签: c# pdfbox pdftotext


【解决方案1】:

您需要将文档中的输入流提供给构造函数。

【讨论】:

  • 使用 org.pdfbox.pdmodel;使用 org.pdfbox.util;使用 System.Data.SqlClient;使用 org.pdfbox.pdfparser;字符串文件文本 = Path.GetFileNameWithoutExtension(path) + ".txt"; string newpath = Path.GetFullPath(path).Replace(Path.GetFileName(path), filetext); PDFParser pdfParser = new PDFParser(文件名); pdfParser.ExtractText(path, newpath);
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-05-12
  • 2018-07-18
  • 2017-02-19
  • 2011-06-14
  • 2013-05-30
  • 2012-11-02
  • 1970-01-01
相关资源
最近更新 更多