日期:2014-05-18 浏览次数:20974 次
<%@ 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>