国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

C#使用iTextSharp從PDF文檔獲取內(nèi)容的方法

2020-01-24 01:43:05
字體:
供稿:網(wǎng)友

本文實例講述了C#使用iTextSharp從PDF文檔獲取內(nèi)容的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

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;  } }}

希望本文所述對大家的C#程序設(shè)計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 淳化县| 鹿邑县| 博爱县| 丹东市| 绥滨县| 哈巴河县| 腾冲县| 乐至县| 得荣县| 乐山市| 荆门市| 阿瓦提县| 万山特区| 宁阳县| 南溪县| 宜宾市| 玉溪市| 乐都县| 连州市| 岗巴县| 花莲县| 阳曲县| 大庆市| 正蓝旗| 黑山县| 泾川县| 宜宾市| 海阳市| 离岛区| 申扎县| 陕西省| 长兴县| 伽师县| 九江市| 广西| 汽车| 天津市| 新河县| 玉田县| 卢龙县| 巴马|