We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unexpected shadow effect shows up (728)

Hi,

In both of the attached presentations, I’ve created a portion with the same font height, color and text as the actual portion, removed the old one and added the new one to the paragraph. As you can see in the attached screenshot, there is a shadow effect in the saved presentation which did not exist in the source one.


Here’s the code I used:

Test.pptx:

String path = “Test.pptx”;

InputStream inputStream = new FileInputStream(path);

Presentation presentation = new Presentation(inputStream);

inputStream.close();

ISlide slide = presentation.getSlides().get_Item(0);

IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(3);

IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(1);

IPortion oldPortion = paragraph.getPortions().get_Item(0);

IPortion newPortion = new Portion();

IPortionFormat portionFormat = newPortion.getPortionFormat();

portionFormat.setFontHeight(oldPortion.createPortionFormatEffective().getFontHeight());
portionFormat.getFillFormat().setFillType(FillType.Solid);
portionFormat.getFillFormat().getSolidFillColor()
.setColor(oldPortion.createPortionFormatEffective().getFillFormat().getSolidFillColor());
newPortion.setText(oldPortion.getText());

paragraph.getPortions().clear();
paragraph.getPortions().add(newPortion);

presentation.save(“Test-aspose.pptx”, SaveFormat.Pptx);

Test1.pptx:

String path = “Test1.pptx”;

InputStream inputStream = new FileInputStream(path);

Presentation presentation = new Presentation(inputStream);

inputStream.close();

ISlide slide = presentation.getSlides().get_Item(0);

IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(1);

IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
IPortion oldPortion = paragraph.getPortions().get_Item(0);
IPortion newPortion = new Portion();

IPortionFormat portionFormat = newPortion.getPortionFormat();

portionFormat.setFontHeight(oldPortion.createPortionFormatEffective().getFontHeight());
portionFormat.getFillFormat().setFillType(FillType.Solid);
portionFormat.getFillFormat().getSolidFillColor()
.setColor(oldPortion.createPortionFormatEffective().getFillFormat().getSolidFillColor());
newPortion.setText(oldPortion.getText());

paragraph.getPortions().clear();
paragraph.getPortions().add(newPortion);

presentation.save(“Test1-aspose.pptx”, SaveFormat.Pptx);

Can you check this?

Thanks,
Zeljko

Hi Zeljko,

I have worked with presentation file shared by you using Aspose.Slides for JAVA 17.3.0 and have been able to observe the issue. A ticket with ID SLIDESJAVA-36213 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

We are sorry for your inconvenience,