itextsharp-all-5.1.2.zip下载地址点击下载 引入itextsharp.dll
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;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.xml;
namespace PDFR
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//退出程序的按钮
private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
//开始运行程序的按钮
private void button1_Click(object sender, EventArgs e)
{
string pdfStr = readPDF(文件名);
System.IO.File.WriteAllText(文件名, pdfStr);