• 大小: 4.33MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-10-12
  • 语言: C#
  • 标签: c#  pdf  doc  

资源简介

c#写的pdf转word程序源码项目,基于的环境是.net 4.0;

资源截图

代码片段和文件信息

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 System.IO;
using Spire.Pdf;

namespace PDF2word
{
    public partial class Form1 : Form
    {
        protected string fName;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(fName);
            string savePath = Path.GetDirectoryName(fName);
            string saveName = Path.GetFileNameWithoutExtension(fName) + “.docx“;
            string saveFile = Path.Combine(savePath saveName);
            this.label2.Text = “开始转换。。。。“;
            doc.SaveToFile(saveFile FileFormat.DOC);
            System.Diagnostics.Process.Start(saveFile);
            this.label2.Text = “转换完成“;
        }

        private void button2_Click(object sender EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = “c:\\“;//注意这里写路径时要用c:\\而不是c:\
            openFileDialog.Filter = “文本文件|*.pdf“;
            openFileDialog.RestoreDirectory = true;
            openFileDialog.FilterIndex = 1;
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                fName = openFileDialog.FileName;
                this.label1.Text = fName;
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        144  2018-12-01 21:17  pdf2word\PDF2word\PDF2word\app.config

     文件       9728  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\bin\Debug\PDF2word.exe

     文件        144  2018-12-01 21:17  pdf2word\PDF2word\PDF2word\bin\Debug\PDF2word.exe.config

     文件      24064  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\bin\Debug\PDF2word.pdb

     文件      11600  2018-12-02 14:32  pdf2word\PDF2word\PDF2word\bin\Debug\PDF2word.vshost.exe

     文件        144  2018-12-01 21:17  pdf2word\PDF2word\PDF2word\bin\Debug\PDF2word.vshost.exe.config

     文件        490  2010-03-17 22:39  pdf2word\PDF2word\PDF2word\bin\Debug\PDF2word.vshost.exe.manifest

     文件      45056  2018-12-01 21:35  pdf2word\PDF2word\PDF2word\bin\Debug\Spire.License.dll

     文件   12111872  2018-08-28 11:13  pdf2word\PDF2word\PDF2word\bin\Debug\Spire.Pdf.dll

     文件       1634  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\Form1.cs

     文件       3733  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\Form1.Designer.cs

     文件       5817  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\Form1.resx

     文件       3744  2018-12-02 14:32  pdf2word\PDF2word\PDF2word\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6209  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        828  2018-12-02 14:32  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.csproj.FileListAbsolute.txt

     文件        975  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.csproj.GenerateResource.Cache

     文件      35471  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.csprojResolveAssemblyReference.cache

     文件       9728  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.exe

     文件        180  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.Form1.resources

     文件      24064  2018-12-01 22:07  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.pdb

     文件        180  2018-12-01 21:51  pdf2word\PDF2word\PDF2word\obj\x86\Debug\PDF2word.Properties.Resources.resources

     文件       4608  2018-12-01 22:05  pdf2word\PDF2word\PDF2word\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       4038  2018-12-01 21:51  pdf2word\PDF2word\PDF2word\PDF2word.csproj

     文件        489  2018-12-01 20:53  pdf2word\PDF2word\PDF2word\Program.cs

     文件       1348  2018-12-01 20:53  pdf2word\PDF2word\PDF2word\Properties\AssemblyInfo.cs

     文件       2856  2018-12-01 21:17  pdf2word\PDF2word\PDF2word\Properties\Resources.Designer.cs

     文件       5612  2018-12-01 20:53  pdf2word\PDF2word\PDF2word\Properties\Resources.resx

     文件       1108  2018-12-01 21:17  pdf2word\PDF2word\PDF2word\Properties\Settings.Designer.cs

     文件        249  2018-12-01 20:53  pdf2word\PDF2word\PDF2word\Properties\Settings.settings

     文件        866  2018-12-01 20:53  pdf2word\PDF2word\PDF2word.sln

............此处省略14个文件信息

评论

共有 条评论