• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Aspose实现Office转PDF(ASP.NET)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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);
            
    }
}

 


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);
            
    }
}

 




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
长时间执行ASP.NET导致错误[HttpRequesttimedout]错误发布时间:2022-07-10
下一篇:
asp.net中.ASPX与.CS文件的关系发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap