本资源是已编译好,最新版PDFbox1.8.9,直接用于C#
1、在代码中引用
IKVM.OpenJDK.Core.dll
IKVM.OpenJDK.SwingAWT.dll
pdfbox-1.8.9.dll
2、将下列DLL复制到程序编译目录
commons-logging.dll
fontbox-1.8.9.dll
IKVM.OpenJDK.Text.dll
IKVM.OpenJDK.Util.dll
IKVM.Runtime.dll
fontbox-1.8.9.dll
3、Sample code (C#)
using org.apache.pdfbox.pdmodel;
using org.apache.pdfbox.util;
// ...
private static string ExtractTextFromPdf(string path)
{
PDDocument doc = null;
try {
doc = PDDocument.load(path)
PDFTextStripper stripper = new PDFTextStripper();
return stripper.getText(doc);
}
finally {
if (doc != null) {
doc.close();
}
}
}
2021-04-12 18:44:03
7.90MB
PDFBox
1