Dear Team,
We have been using Aspose library since 1 years, but we have never faced this type of issue, while saving our presentation using below code its taking long time, in higher environment its taking long time as well as showing error while downloading file with 400 response. I would really appreciate if you could help us to overcome this issue as it is a blocker for us. FYI PPT download is main functionality of our application.
Note : We are using license version of Aspose Library 22.7.
JDK : 17
Windows 10
Sample code:
Presentation presentation;
OutputStream out = null;
FileName fileName = "MyPres";
String currentDirectory = System.getProperty("user.dir");
fileName = currentDirectory + fileName;
response.setHeader("Content -Type", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
response.setHeader("Content-Disposition", "attachemnt; filename=\"" +fileName +".pptx\"")
File tempFile = File.createTempFile(fileName, ".pptx", new File(currentDirectory));
try (FileOutputStream os = new (FileOutputStream (tempFile)){
presentation.save(os, SaveFormat.pptx);
}
byte[] fileBytes = FileUtils.readFilByteArray(tempFile);
out = response.getOitputStream();
out.write(fileBytes);
out.close();
Thanks
@ajaymoharana,
It seems like you’re experiencing performance issue while saving and downloading PowerPoint presentations in a web project. We recommend that you kindly try the latest version of Aspose.Slides for Java v24.5.
If you still encounter the issue with latest version/fix, please provide a standalone sample project with sample files to reproduce the issue. We will check it soon.
@amjad.sahi
Thanks for the response, FYI we have upgraded to 24.4, which was approved by our organization, however we are still facing same issue. Could you please suggest, as it is blocker for us now.
Thanks,
@ajaymoharana,
Could you please create a standalone sample project/app (complete source code without compilation errors) with sample files to reproduce the issue on our end. We will check your issue soon.
@amjad.sahi
It would be little difficult to share the code as we are not supposed to share any code out side the client, but as per the analysis the issue is with while saving the presentation, is it possible to find the solution from the above mention sample code.
Thanks for the understanding.
@ajaymoharana,
Upon reviewing your code segment, we are uncertain about which PowerPoint presentation file you are loading and what data, contents, and objects you are inserting into the slides. Therefore, we need your simulation application (with resource files) to replicate the issue on our end. You may create a separate and simple application and provide us. By the way, could you please attempt to read/open the PowerPoint presentation file (e.g., via the built-in java.io package) without using Aspose.Slides APIs, and then save it using the response object to determine if the issue persists or not?