import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import com.aspose.words.Document;
import com.aspose.words.License;
import com.aspose.words.SaveFormat;
import com.sunxung.factoring.component.exception.BusinessException;
import com.sunxung.factoring.component.util.CodeUtil;
public class AsopUtil {
public static File doc2pdf(String inPath, String outPath) {
if (!getLicense()) { // 验证License 若不验证则转化出的pdf文档会有水印产生
// return;
throw new BusinessException(CodeUtil.FAIL, "验证License失败");
}
File file = null;
//outPath = "testFile/test.pdf";
//inPath="testFile/test.docx";
try {
long old = System.currentTimeMillis();
file = new File(outPath); // 新建一个空白pdf文档
if (!file.getParentFile().exists()) {
file.getParentFile()
word转pdf
最新推荐文章于 2025-03-15 11:52:01 发布