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

Free Support Forum - aspose.com

Presentation.save() lasts too long (1659)


I’m trying to modify the attached presentation by clearing text from each paragraph’s portion collection and adding three new portions. The first one and the last one contain only the space character, while the middle one contains paragraph’s text. The problem occurs when I try to save the presentation. The action never completes.

Here’s the code I used:

    IPresentation presentation = new Presentation("1.pptx");

	ISlideCollection slides = presentation.getSlides();

	for (ISlide slide : slides) {

		IShapeCollection shapes = slide.getShapes();

		for (IShape shape : shapes) {

			if (shape instanceof IAutoShape) {

				ITextFrame textFrame = ((IAutoShape) shape).getTextFrame();

				if (textFrame != null) {

					IParagraphCollection paragraphs = textFrame.getParagraphs();

					for (IParagraph paragraph : paragraphs) {

						String paragraphText = paragraph.getText();

						IPortionCollection portions = paragraph.getPortions();

						if (portions.getCount() > 0) {

							IPortion formattingPortion = portions.get_Item(0);


							IPortion spacePortion = new Portion((Portion) formattingPortion);
							spacePortion.setText(" ");


							IPortion newPortion = new Portion((Portion) formattingPortion);



							spacePortion = new Portion((Portion) formattingPortion);
							spacePortion.setText(" ");








	FileOutputStream outputStream = new FileOutputStream("1-aspose.pptx");

	presentation.save(outputStream, SaveFormat.Pptx);


Environment info:

Ubuntu 16.04 x64
java version “1.8.0_161”


1.pptx.zip (2.4 MB)


I have worked with presentation file shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-37008 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as SLIDESJAVA-37008) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz