0.添加Aspose的DLL


1.可以直接去官网下载,不过默认是带水印的,如需去除水印可以购买

2.当然也可以在国内的一些下载站下载

3.将Aspose.Cells.dll、Aspose.Words.dll 两个文件添加到项目的bin目录下

4.给大家提供一个学习用地址:http://www.dxper.net/thread-4028-1-1.html

PS:ppt转pdf用.net2.0文件夹下的Aspose.Slides.dll即可

1.Word转PDF


1.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aspose.Words;
using Aspose.Words.Saving;
using System.IO;
using System.Drawing;
using System.Text;
using Aspose.Cells;
public partial class Word2PDF : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Document doc = new Document(@"C:\Users\DUANCHENGHUA\Desktop\质量月PPT\2015年质量月活动方案 - 副本.doc");
doc.Save(@"C:\Users\DUANCHENGHUA\Desktop\2015年质量月活动方案 - 副本.pdf", Aspose.Words.SaveFormat.Pdf); }
}

2.Excel转PDF、PPT转PDF


1.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aspose.Words;
using Aspose.Words.Saving;
using System.IO;
using System.Drawing;
using System.Text;
using Aspose.Cells;//Excel
using Aspose.Slides;//PPT
public partial class Word2PDF : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//Excel
Workbook excel = new Workbook(@"C:\Users\DUANCHENGHUA\Desktop\数据库信息表.xlsx");
excel.Save(@"C:\Users\DUANCHENGHUA\Desktop\数据库信息表.pdf", Aspose.Cells.SaveFormat.Pdf);
//PPT
Presentation ppt = new Presentation(@"C:\Users\DUANCHENGHUA\Desktop\2015年质量月活动1509.ppt");
ppt.Save(@"C:\Users\DUANCHENGHUA\Desktop\2015年质量月活动1509.pdf", Aspose.Slides.Export.SaveFormat.Pdf);
//PPTX
Aspose.Slides.Pptx.PresentationEx pptx = new Aspose.Slides.Pptx.PresentationEx(@"C:\Users\DUANCHENGHUA\Desktop\演示文稿1.pptx");
pptx.Save(@"C:\Users\DUANCHENGHUA\Desktop\演示文稿1.pdf", Aspose.Slides.Export.SaveFormat.Pdf); }
}

Aspose实现Office转PDF (ASP.NET)的更多相关文章

  1. java操作office和pdf文件java读取word,excel和pdf文档内容

    在平常应用程序中,对office和pdf文档进行读取数据是比较常见的功能,尤其在很多web应用程序中.所以今天我们就简单来看一下Java对word.excel.pdf文件的读取.本篇博客只是讲解简单应 ...

  2. Aspose.word直接转pdf

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  3. 记录libreoffice实现office转pdf(适用于windows、linux)

    由于目前的工作跟office打交道比较多,所以才有了此篇blog,需求是实现word转换pdf方便页面展示.之前lz采用的是jacob(仅支持windows)进行转换的,但是现在服务器改成linux显 ...

  4. Confluence 6 Office 和 PDF 文件

    插入一个文件到页面中是能够让你将有用的文件,电子表格,幻灯片或者其他可用的文件在你小组中进行分享的好方法. 针对所有的文件类型,你可以选择以链接方式插入一个文件.缩略图将会对文档的内容进行预览同时可以 ...

  5. openoffice+pdf2swf+FlexPaper在线显示office和pdf

    前提:本人的系统为Ubuntu 13.10 64位系统.本篇是我在配置好环境后一段时间写的,所以操作上可能会有也错误,因此仅供参考. 搜索在线显示office和pdf,最常见的方法就是把都转为swf, ...

  6. ASP.NET VS2013 Office 转 PDF

    本文适用于VS2013 项目中的Word转换为PDF.Excel转换为PDF.PPT转换为PDF 0.一种更加简单方便的方法 1.本页所用的方法在本机测试时基本不会出现问题,只是偶尔PPT转PDF失败 ...

  7. .Net有许多Office,PDF,Email,HTML的控件

    比如: Aspose.Total for .NET includes the following components: Aspose.Words for .NET 16.3.0 (4/13/2016 ...

  8. java使用jacob将office转pdf

    1.此处代码是把office文档转换成pdf的工具类,在BS架构的产品中,我们可以使用基于JS的pdf插件显示pdf文档,但是前提IE需要按照adobe的pdf软件,对于非IE不用安装.2.可以基于f ...

  9. Highcharts 本地导出图片和PDF asp.net mvc版

    啰嗦: 现在大家利用Highcharts开发时,有时候会遇到导出的功能问题,但是highcharts默认是链接自己的服务器上进行处理,但是有时候我们会连不上他的服务器,所以我们要让他在我们的服务器上进 ...

随机推荐

  1. JavaScript语言学习中的注意事项

    javascript: 基于浏览器 基于对象 事件驱动 脚本语言 由: javascript: ECMAscript(ES) DOM文档对象模型 BOM浏览器对象模型,三部分组成 使用js的三种方式 ...

  2. elasticsearch例子(crud + 分页)

    概述 基于elasticsearch2.3.3写的入门demo,含有创建index,删除index,录入数据,查询.以及分页,并且使用流行的ik分词器.测试方式:使用 JNUIT TEST 来运行. ...

  3. php读取文件内容的三种方法

    <?php //**************第一种读取方式***************************** 代码如下: header("content-type:text/h ...

  4. Leetcode刷题C#版之Toeplitz Matrix

    题目: Toeplitz Matrix A matrix is Toeplitz if every diagonal from top-left to bottom-right has the sam ...

  5. POI导出多张图片到Excel

    package com.sun.office.excel; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStr ...

  6. ios开发常用RGB色值

    iOS中RGB常用的色值,同时可将对颜色的设置定义成宏,方便开发应用,如: // RGB颜色转换(16进制->10进制) #define UIColorFromRGB(rgbValue) [UI ...

  7. Linux下绝对经典的命令

    1.使用远程终端时,可以使用如下命令: screen tmux 2.下载文件可以使用如下命令: curl wget 3.压缩解压缩可以使用: tar .zip.rar 4.使用抓包工具 tcpdump ...

  8. CENTOS6.6下nmon的监控

    本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn Installing Nmon By default nmon is ...

  9. 5、flask之信号和mateclass元类

    本篇导航: flask实例化参数 信号 metaclass元类解析 一.flask实例化参数 instance_path和instance_relative_config是配合来用的:这两个参数是用来 ...

  10. 分布式缓存一致性hash算法理解

    今天阅读了一下大型网络技术架构这本苏中的分布式缓存一致性hash算法这一节,针对大型分布式系统来说,缓存在该系统中必不可少,分布式集群环境中,会出现添加缓存节点的需求,这样需要保障缓存服务器中对缓存的 ...