欢迎来到代码驿站!

.NET代码

当前位置:首页 > 软件编程 > .NET代码

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

时间:2021-06-24 08:19:53|栏目:.NET代码|点击:

只要把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# 泛型类的功能

栏    目:.NET代码

下一篇:使用XmlSerializer序列化List对象成XML格式(list对象序列化)

本文标题:C# 利用Aspose.Words.dll将 Word 转成PDF

本文地址:http://www.codeinn.net/misctech/147407.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有