-
适用于C#的PDFBox-dll(1.8.9 Net版)下载
资源介绍
本资源是已编译好,最新版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();
}
}
}