Step1:下载pdfbox,http://download.csdn.net/detail/cqwei2013/6396083
Step2:把下载包里bin中的IKVM.GNU.Classpath.dll和PDFBox-0.7.3.dll添加到引用中,并且把FontBox-0.1.0-dev.dll和IKVM.Runtime.dll复制到程序的bin/Debug下面
Step3:在程序中引用using org.pdfbox.pdmodel;using org.pdfbox.util;
Step4:
public string ReadPdfFile(string fileName)
{
PDDocument doc = PDDocument.load(fileName);
PDFTextStripper pdfStripper = new PDFTextStripper();
return pdfStripper.getText(doc);
}