import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.sl.usermodel.TextParagraph.TextAlign;
import org.apache.poi.sl.usermodel.VerticalAlignment;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFAutoShape;
import org.apache.poi.xslf.usermodel.XSLFPictureData;
import org.apache.poi.xslf.usermodel.XSLFPictureShape;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import org.apache.poi.xslf.usermodel.XSLFTable;
import org.apache.poi.xslf.usermodel.XSLFTableCell;
import org.apache.poi.xslf.usermodel.XSLFTableRow;
import org.apache.poi.xslf.usermodel.XSLFTextBox;
import org.apache.poi.xslf.usermodel.XSLFTextParagraph;
import org.apache.poi.xslf.usermodel.XSLFTextRun;
import org.jfree.chart.JFreeChart;
1.创建PPT
XMLSlideShow ppt = new XMLSlideShow();
2.导出ppt的每一页的大小
Dimension dimension = new Dimension(width, height);
ppt.setPageSize(dimension);
3. 创建第1页
XSLFSlide xslfSlide = ppt.createSlide();
// 设置输入框位子及大小 x,y,width,height
Rectangle rectangle = new Rectangle(, , , );
4.字体样式
double textsize = 65;
// 是否加粗
boolean textBold = true;
// 字体类型
String textFontFamilyMes = messageSource.getMessage("task.exportPpt.textFontFamily", null,
LocaleContextHolder.getLocale());
String textFontFamily = textFontFamilyMes;
// 字体颜色
Color textFontColor = new Color(58, 62, 85);
5.具体创建内容 创建一个文本框
XSLFTextBox xslfTextBox = xslfSlide.createTextBox();
// 设置文本框填充颜色
xslfTextBox.setFillColor(backgroundFillColor);
// 生成一个新的文本段落