Spire.Presentation for Java 9.3.1 已发布。该版本支持在段落中添加数学公式以及获取形状的显示颜色。此外,合并文档时程序抛“DocumentEditException”异常的问题也已成功修复。详情请查看以下内容。
新功能:
- 支持在段落中添加数学公式。
- 支持了获取形状(shape)的显示颜色。
Presentation ppt = new Presentation();
String latexMathCode="x^{2}+\\sqrt{x^{2}+1=2}";
IAutoShape shape=ppt.getSlides().get(0).getShapes().appendShape(ShapeType.RECTANGLE,new Rectangle2D.Float(30,100,400,200));
shape.getTextFrame().getParagraphs().clear();
ParagraphEx p=new ParagraphEx();
shape.getTextFrame().getParagraphs().append(p);
PortionEx portionEx=new PortionEx("Test");
p.getTextRanges().append(portionEx);
p.appendFromLatexMathCode(latexMathCode);
PortionEx portionEx2=new PortionEx("Hello");
p.getTextRanges().append(portionEx2);
ppt.saveToFile(outputFile, FileFormat.AUTO);
Presentation ppt = new Presentation();
ppt.loadFromFile("input.pptx");
IAutoShape shape = (IAutoShape)ppt.getSlides().get(0).getShapes().get(0);
System.out.println(shape.getDisplayFill().getFillType().getName());
System.out.println(shape.getDisplayFill().getSolidColor().getColor());
问题修复:
- 修复了合并文档时程序抛“DocumentEditException”异常的问题。
获取Spire.Presentation for Java 9.3.1请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-JAVA.html