下载 PDFBox-0.7.3.zip
PDFBox-0.7.3.dll
lucene-demos-2.0.0.dll
lucene-core-2.0.0.dll
bcmail-jdk14-132.dll
bcprov-jdk14-132.dll
FontBox-0.1.0-dev.dll
ICSharpCode.SharpZipLib.dll
IKVM.AWT.WinForms.dll
IKVM.GNU.Classpath.dll
IKVM.Runtime.dll
ikvm-native.dll
放入Bin中
C# code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <%@ Page Language= "C#" %> <%@ Import Namespace= "System" %> <%@ Import Namespace= "org.pdfbox.pdmodel" %> <%@ Import Namespace= "org.pdfbox.util" %> <script language= "C#" runat= "server" > protected void Page_Load( object sender, System.EventArgs e) { string pdfPath = Server.MapPath( "index.pdf" ); PDDocument doc = PDDocument.load(pdfPath); PDFTextStripper stripper = new PDFTextStripper(); string txt = stripper.getText(doc); Response.Write(txt); } </script> |