Issue with aspose-pdf when running from inside web container

Hi,

I am using aspose-pdf-16.11.0 to convert pdf to ppt document.

Below is the sample code:

public void generatePPTReport() {
try {
// Create license object
com.aspose.pdf.License license = new com.aspose.pdf.License();
// Load the license file into FileStream object
InputStream licence = new FileInputStream(new File(“E://Reports//Aspose.Pdf.lic”));
license.setLicense(licence);

// Load source PDF file
InputStream reportDoc = new FileInputStream(new File(“E://Reports//report.pdf”));
System.out.println(reportDoc.available());
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(reportDoc);

// Instantiate PptxSaveOptions instance
com.aspose.pdf.PptxSaveOptions pptx_save = new com.aspose.pdf.PptxSaveOptions();

// Save the output in PPTX format
pdfDocument.save(“E://Reports//report-ppt.pptx”, pptx_save);
reportDoc.close();
} catch (Exception e) {
throw new RuntimeException(“Error thrown while generating PPT using Aspose.pdf.”
+ e.getLocalizedMessage(), e);
}
}

When I run above program from main method using a stand alone java program, then above program work fine and generates PPT file with correct content.

However when I invoke above method from within a container(I am using jetty) then my program blocks on something and it never comes out from execution of following line
pdfDocument.save(“E://Reports//report-ppt.pptx”, pptx_save). Only an empty file report-ppt.pptx is generated. I am sending a simple HTTP request to execute above method.

For your reference I am attaching report.pdf file. Also attaching report-ppt.pptx file generated after execution of above method from standalone java program using main method.

Please look into this and let me know the solution ASAP.

Thanks
Kamal Sethiya





Hi Kamal,


Thanks for using our API’s.

I have tested the scenario in simple console application and the conversion works fine. However for the sake of correction and investigation related to Jetty, I have logged it as PDFJAVA-36436 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi,

I just want to highlight one point over here is that above issue occur only when I start jetty/tomcat in debug mode and place a break point before above code. I am using eclipse and tomcat/jetty.

Thanks
Kamal

Hi Kamal,


Thanks for sharing additional information. We have passed on the information to our product team, they will consider it during issue investigation. We will keep you updated about the issue resolution progress.

Thanks for your patience and cooperation.

Best Regards,

The issues you have found earlier (filed as PDFJAVA-36436) have been fixed in Aspose.PDF for Java 19.5.