zoukankan      html  css  js  c++  java
  • 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();
    }

  • 相关阅读:
    tushare学习
    TVP-VAR模型
    时间序列分析
    python tusahre使用
    金融大讲堂-笔记
    多元GARCH模型
    方差与协方差
    代码生成器,项目更新第一版,mybatis-plus
    Springboot手动搭建项目——配置mybatis tk框架
    java基础,集合,HashMap,源码解析
  • 原文地址:https://www.cnblogs.com/gaoruideboke/p/13613918.html
Copyright © 2011-2022 走看看