word文檔轉pdf解決修訂問題


問題描述:word轉pdf后,word的修改痕跡沒去掉,如下圖轉pdf后痕跡還在

 

 使用的轉pdf工具:Aspose.Words

//可接受修訂 解決修訂問題
doc.acceptAllRevisions();
 
應用項目中代碼:
word轉pdf
private Result convertWord(String sourcePath,String pdfPath){
    try {
        Document word = new Document(sourcePath);
        word.acceptAllRevisions();
        HtmlFixedSaveOptions fixedSaveOptions = new HtmlFixedSaveOptions();
        fixedSaveOptions.setPrettyFormat(true);
        fixedSaveOptions.setShowPageBorder(false);
        fixedSaveOptions.setExportEmbeddedCss(false);
        fixedSaveOptions.setExportEmbeddedFonts(true);
 
        word.save(pdfPath);
        logger.debug("pdf converted, pdfPath: " + pdfPath);
 
        logger.debug("convert complete");
 
    }catch (Exception e){
        e.printStackTrace();
        return Result.error(e);
    }
    return Result.success();
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM