zoukankan      html  css  js  c++  java
  • POI中操作PPT获得每页的TABLE

    HSLFSlideShow slideShow = new HSLFSlideShow(bufferInputUtil.getBufferedInputStream());
            logger.info("正在脱敏:每页幻灯片的文本和表格内容");
            for (HSLFSlide slide : slideShow.getSlides()) {
                for (HSLFShape hslfShape : slide.getShapes()) {
                    if (hslfShape instanceof HSLFTable) {
                        hslfTable = (HSLFTable) hslfShape;
                        rowSize = hslfTable.getNumberOfRows();
                        columnSize = hslfTable.getNumberOfColumns();
                        for (int i = 0; i < rowSize; i++) {
                            for (int j = 0; j < columnSize; j++) {
                                cellValue = hslfTable.getCell(i, j).getText();
                                if (StringUtils.isNotBlank(cellValue) && StringUtils.isNotEmpty(cellValue)) {
                                    hslfTable.getCell(i, j).setText(this.getReplace(cellValue));
                                }
                            }
                        }
                    } else if (hslfShape instanceof HSLFTextShape) {
                        textShape = (HSLFTextShape) hslfShape;
                        cellValue = textShape.getText();
                        if (StringUtils.isNotBlank(cellValue) && StringUtils.isNotEmpty(cellValue)) {
                            textShape.setText(this.getReplace(cellValue));
                        }
                    }
                }
            }
     
    请见红色代码!
     
  • 相关阅读:
    SpringMVC + MyBatis简单示例
    JSP---JSTL核心标签库的使用
    HBASE安装 (HA)
    HBase 常用Shell命令(转载)
    kafka quick start
    在IDEA中实战Git
    kibana6.2.2安装
    elasticsearch-head插件安装
    elasticsearch6.2.2安装
    jdk1.8安装
  • 原文地址:https://www.cnblogs.com/huiy/p/6000873.html
Copyright © 2011-2022 走看看