C# 利用Aspose.Words.dll将 Word 转成PDF

Pythia ·
更新时间:2024-09-21
· 576 次阅读

只要把aspose.words.dll 在bin中添加引用即可。
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Aspose.Words;
using Aspose.Words.Saving;
using System.IO;

namespace NewConvertBook
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //读取doc文档
            Document doc = new Document(@"C:\Users\Administrator\Desktop\流调系统存在问题 .doc");
            //保存为PDF文件,此处的SaveFormat支持很多种格式,如图片,epub,rtf 等等
            doc.Save("temp.pdf", SaveFormat.Pdf);

        }
    }
}

对了还要再说一下,这个dll是有水印的。如果需要无水印的。请购买正版的dll。或者使用破解版(不推荐,请支持作者权益)

Aspose.Words.dll 官网http://www.aspose.com/。具体其他用法可以参考api及文档。

您可能感兴趣的文章:C#使用iTextSharp封装的PDF文件操作类实例C#使用itextsharp生成PDF文件的实现代码C# 生转换网页为pdfC# 中使用iTextSharp组件创建PDF的简单方法C#将jpg转换为pdf的方法C#使用iTextSharp从PDF文档获取内容的方法C#实现pdf导出 .Net导出pdf文件C#实现HTML转WORD及WORD转PDF的方法用C#来解析PDF文件C#使用private font改变PDF文件的字体详解



dll words aspose C# pdf

需要 登录 后方可回复, 如果你还没有账号请 注册新账号