try {
// 获取PPT文件
String pptModelPath =ConfigReadUtil.getInstance().getConfigItem("ppt_path"); //获取路径
FileInputStream is = new FileInputStream(pptModelPath+"2.pptx"); //读pptx存放的路径
XMLSlideShow ppt = new XMLSlideShow(is);
is.close();
for (XSLFSlide slide : ppt.getSlides()) {
// 获取每一张幻灯片中的shape
for (XSLFShape shape : slide.getShapes()) {
Rectangle2D anchor = shape.getAnchor();
if (shape instanceof XSLFTextShape) {
XSLFTextShape txShape = (XSLFTextShape) shape;
if (txShape.getText().contains("{time}")) {
// 替换文字内容
txShape.setText(txShape.getText().replace(
"{time}", time1));
}else if (txShape.getText().contains("{eight}")) {
// 替换文字内容
txShape.setText(txShape.getText().replace(
<