利用Aspose转PDF


添加引用:

using Aspose.Cells;
using Aspose.Slides;
using Aspose.Words;

 

/// <summary>
        /// PPT转PDF
        /// </summary>
        /// <param name="InPath">输入路径</param>
        /// <param name="OutPath">输出路径</param>
        public void PPT_PDF(string InPath, string OutPath)
        {
            Presentation ppt = new Presentation(InPath);
            ppt.Save(OutPath, Aspose.Slides.Export.SaveFormat.Pdf);
        }
        /// <summary>
        /// Word转PDF
        /// </summary>
        /// <param name="InPath"></param>
        /// <param name="OutPath"></param>
        public void Word_PDF(string InPath, string OutPath)
        {
            Document doc = new Document(InPath);
            doc.Save(OutPath, Aspose.Words.SaveFormat.Pdf);
        }
        /// <summary>
        /// Excel转PDF
        /// </summary>
        /// <param name="InPath"></param>
        /// <param name="OutPath"></param>
        public void Excel_PDF(string InPath, string OutPath)
        {
            Workbook excel = new Workbook(InPath);
            excel.Save(OutPath, Aspose.Cells.SaveFormat.Pdf);
        }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM