Aspose.Words将word转成pdf


Aspose.Words将word转成pdf

/// <summary>
        /// word转pdf
        /// </summary>
        /// <param name="path">文件地址</param>
        /// <param name="newFilePath">转换后的文件地址</param>
        /// <returns></returns>
        public static void WordToPdf(string path, string newFilePath)
        {
            var dir = newFilePath.Substring(0, newFilePath.LastIndexOf("/") + 1);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            Aspose.Words.Document doc = new Aspose.Words.Document(path);
            doc.Save(newFilePath);
        }

 


免责声明!

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



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