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,
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,
The issues you have found earlier (filed as PDFJAVA-36436) have been fixed in Aspose.PDF for Java 19.5.