加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-15 05:42:02 所属栏目:百科 来源:网络整理
导读:只要把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 Aspo

只要把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:UsersAdministratorDesktop流调系统存在问题 .doc");
            //保存为PDF文件,此处的SaveFormat支持很多种格式,如图片,epub,rtf 等等
            doc.Save("temp.pdf",SaveFormat.Pdf);

        }
    }
}


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

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

您可能感兴趣的文章:

  • C#对Word文档的创建、插入表格、设置样式等操作实例
  • C#设置Word文档背景的三种方法(纯色/渐变/图片背景)
  • C# 向Word中设置/更改文本方向的方法(两种)
  • C#添加、读取Word脚注尾注的方法
  • C# WORD操作实现代码
  • C#实现通过模板自动创建Word文档的方法
  • C# Word 类库的深入理解
  • 比较全的一个C#操作word文档示例
  • asp.net(c#)下读取word文档的方法小结
  • C#如何更改Word的语言设置

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读