码迷,mamicode.com
首页 > Web开发 > 详细

Aspose.word直接转pdf

时间:2017-10-28 22:03:36      阅读:599      评论:0      收藏:0      [点我收藏+]

标签:send   cti   bar   pos   slides   export   cli   doc   partial   

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.word直接转pdf

标签:send   cti   bar   pos   slides   export   cli   doc   partial   

原文地址:http://www.cnblogs.com/sguozeng/p/7748005.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!