import com.aspose.words.Document;
import com.aspose.words.PdfSaveOptions;
public static void aaa(String wordFile, String pdfFile) throws Exception {
// Document wordDoc = new Document(wordFile);
// PdfSaveOptions pso = new PdfSaveOptions();
// wordDoc.save(pdfFile, pso);
new Document(wordFile).save(pdfFile,new PdfSaveOptions());
}
需要结合外部文件aspose实现。
doc文件:
转换后PDF文档: