Word或Excel 转Pdf 工具类(License 去水印)

Word或Excel 转Pdf 帮助类

需要引入jar包:
aspose-words-15.8.0-jdk16.jar
aspose-cells-8.5.2.jar

工具类
import com.aspose.cells.Workbook;
import com.aspose.words.Document;
import com.aspose.words.License;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Map;

/**
 * Word或Excel 转Pdf 帮助类
 * @author zhangsonglin
 * 备注:需要引入 aspose-words-15.8.0-jdk16.jar / aspose-cells-8.5.2.jar
 */
public class PdfUtil {

    private static boolean getLicense() {
        boolean result = false;
        try {
            //InputStream is = PdfUtil.class.getClassLoader().getResourceAsStream("license.xml"); // license.xml应放在..\WebRoot\WEB-INF\classes路径下

            String path = "D:\\2222\\license.xml";//license.xmll路径
            File file = new File(path);
            InputStream is = new FileInputStre

你可能感兴趣的:(又吃成长快乐了)