Hi,
I came across a huge problem with the latest Aspose.Slides for Java 16.6.0.
I have a simple .ppt presentation with one paragraph of text. I created new portion with some text and set it’s bold and italic attributes to false. I then cleared all the portions from the mentioned paragraph and added newly created portion. When I saved the presentation and opened it in PowerPoint, my newly added portion’s text appeared as both bold and italic.
This happened for almost every .ppt file, but not .pptx.
Here’s the code I use:
String presentationPath = “SimplePptFile.ppt”;
InputStream inputStream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(inputStream);
inputStream.close();
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(0);
IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
IPortionCollection portions = paragraph.getPortions();
portions.clear();
IPortion portion = new Portion(“New Portion”);
IPortionFormat portionFormat = portion.getPortionFormat();
portionFormat.setFontBold(NullableBool.False);
portionFormat.setFontItalic(NullableBool.False);
portions.add(portion);
presentation.save(“SimplePptFile-aspose.ppt”, SaveFormat.Ppt);
Can you check this?
Thanks,
Zeljko