Spire.Presentation for Java 9.7.6 supports adding comments to specified text in PowerPoint

2024-07-31 02:12:28

We are pleased to announce the release of Spire.Presentation for Java 9.7.6. This version supports adding comments to specified text in PowerPoint, and also fixes some known issues, such as the incorrect shape height after adding content to the shape. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREPPT-2559 Supports adding comments to specified text in PowerPoint.
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("TextTextmdTextText\ttmdTextTextmdText\ttmdTextTextmdtEXT\ttTextmd");
paragraphEx.getTextRanges().append(ex);
ICommentAuthor commentAuthor = ppt.getCommentAuthors().addAuthor("test","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("test","18");
paragraphEx.addComment(commentAuthor,slide,shape,portionEx,"123456789");
String result = "result.pptx";
ppt.saveToFile(result, FileFormat.PPTX_2013);
Bug SPIREPPT-2550 Fixes the issue that the shape height was incorrect after adding content to the shape.
Bug SPIREPPT-2560 Fixes the issue that the effect of modifying the shape position was incorrect.
Bug SPIREPPT-2561 Fixes the issue that the greater-than and less-than symbols in Latex formulas were parsed incorrectly.
Click the link below to download Spire.Presentation for Java 9.7.6: