Spire.Presentation for Java 9.7.6 已发布。该版本支持给指定文本添加批注,并修复了一些已知问题,如添加内容到形状后,形状高度不正确的问题。详情请查看以下内容。
新功能:
- 支持给指定文本添加批注。
Presentation ppt = new Presentation();
ISlide slide = ppt.getSlides().get(0);
IAutoShape shape = ppt.getSlides().get(0).getShapes().appendShape(ShapeType.RECTANGLE, new Rectangle2D.Double(100, 250, 350, 200));
ppt.getSlides().get(0).getShapes().get(0).getLine().getFillFormat().getSolidFillColor().setColor(Color.white);
shape.getFill().setFillType(FillFormatType.SOLID);
shape.getFill().getSolidColor().setColor(Color.GRAY);
ParagraphEx paragraphEx = shape.getTextFrame().getTextRange().getParagraph();
PortionEx ex = new PortionEx("文本文本文本md文本文本文本文本\ttmd文本文本文本文本md文本文本文本文\tt本md文本文本文本文本md文本文\tt本文本文本md文");
paragraphEx.getTextRanges().append(ex);
ICommentAuthor commentAuthor = ppt.getCommentAuthors().addAuthor("测试","12");
paragraphEx.addComment(commentAuthor,slide,shape,ex,"123");
String result = "result.pptx";
ppt.saveToFile(result, FileFormat.PPTX_2013);
Presentation ppt = new Presentation();
ppt.loadFromFile(inputFile);
ISlide slide = ppt.getSlides().get(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get(0);
ParagraphEx paragraphEx = shape.getTextFrame().getTextRange().getParagraph();
PortionEx portionEx = paragraphEx.getTextRanges().get(0);
ICommentAuthor commentAuthor = ppt.getCommentAuthors().addAuthor("测试","18");
paragraphEx.addComment(commentAuthor,slide,shape,portionEx,"123456789");
String result = "result.pptx";
ppt.saveToFile(result, FileFormat.PPTX_2013);
问题修复:
- 修复了添加内容到形状后,形状高度不正确的问题。
- 修复了修改形状位置,效果不正确的问题。
- 修复了解析 Latex 公式大于和小于符号不正确的问题。
获取 Spire.Presentation for Java 9.7.6 请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-JAVA.html