zoukankan      html  css  js  c++  java
  • Aspose.word直接转pdf

    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:UsersDUANCHENGHUADesktop质量月PPT2015年质量月活动方案 - 副本.doc");
            doc.Save(@"C:UsersDUANCHENGHUADesktop2015年质量月活动方案 - 副本.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:UsersDUANCHENGHUADesktop数据库信息表.xlsx");
            excel.Save(@"C:UsersDUANCHENGHUADesktop数据库信息表.pdf", Aspose.Cells.SaveFormat.Pdf);
            //PPT
            Presentation ppt = new Presentation(@"C:UsersDUANCHENGHUADesktop2015年质量月活动1509.ppt");
            ppt.Save(@"C:UsersDUANCHENGHUADesktop2015年质量月活动1509.pdf", Aspose.Slides.Export.SaveFormat.Pdf);
            //PPTX
            Aspose.Slides.Pptx.PresentationEx pptx = new Aspose.Slides.Pptx.PresentationEx(@"C:UsersDUANCHENGHUADesktop演示文稿1.pptx");
            pptx.Save(@"C:UsersDUANCHENGHUADesktop演示文稿1.pdf", Aspose.Slides.Export.SaveFormat.Pdf);
                
        }
    }
  • 相关阅读:
    int k=0;k=k++;结果等于0,为什么?
    CentOS在无法连接外网的服务器上安装软件(以docker为例)
    docker搭建 elasticsearch 集群
    docker容器之间进行网络通信
    Kafka集群搭建
    Zookeeper集群搭建及常用命令
    SpringBoot将Swagger2文档导出为markdown或html
    Linux(CentOS7)虚拟机修改 NAT模式固定IP
    Linux Maven私服(Nexus)搭建
    Linux配置开机自启动
  • 原文地址:https://www.cnblogs.com/sguozeng/p/7748005.html
Copyright © 2011-2022 走看看