版本:23.8
编程语言:java
问题截图:
源文件:
通知-表头-副本.zip (6.8 KB)
以下是转换代码:
package com.qiyuesuo.aspose;
import com.aspose.words.Document;
import com.aspose.words.PdfSaveOptions;
import com.aspose.words.SaveFormat;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
public class WordUtils {
public static void main(String[] args) throws Exception {
Document doc = new Document(Files.newInputStream(Paths.get("E:\\Emobile-Download\\通知-表头-副本.doc")));
OutputStream out = new FileOutputStream("E:\\Emobile-Download\\通知-表头-副本.pdf");
doc.getLayoutOptions().setCommentDisplayMode(0);
doc.acceptAllRevisions();
PdfSaveOptions opts = new PdfSaveOptions();
opts.setUpdateFields(false);
opts.setSaveFormat(SaveFormat.PDF);
doc.save(out, opts);
}
}