java使用Aspose word文档转pdf功能实现
主要步骤
使用Aspose进行文档转换,首先引入相应的jar包到系统环境
项目resource下导入license.xml文件
使用Aspose时,需要调用设置License方法,设置完成第一次转换比较慢,再次就不需要设置License方法,效率会更高。
注意:使用Aspose时,每一个模块(words,pdf,cells)都有相同的类,如License类,SaveOptions类,SaveFormat类,功能各不相同。
获取license示例代码:
package com.sinoif.common.utils;
import com.aspose.words.License;
import lombok.extern.slf4j.Slf4j;
import java.io.InputStream;
/**
* @description:
* @author: guanlj
* @date: 2020/7/24 11:10
*/
@Slf4j
public class AsposeLicenseUtil {
private static License aposeLic = new License();
/**
* 获取License的输入流
*
* @return
*/
private static InputStream getLicenseInput() {