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