使用 iTextSharp 从 PDF 文档获取内容
2012-05-20 07:45:38 来源:WEB开发网核心提示:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using Syste
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using iTextSharp.text.pdf; using iTextSharp.text.pdf.parser; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); ExtractTextFromPDFPage("c:\sample.pdf", 1); } public void ExtractTextFromPDFPage(string pdfFile, int pageNumber) { PdfReader reader = new PdfReader(pdfFile); string text = PdfTextExtractor.GetTextFromPage(reader, pageNumber); try { reader.Close(); } catch { } richTextBox1.Text = text; } } }
Tags:使用 iTextSharp PDF
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接