Hi,
by using Aspose.slides 24.10, we saw issue when convert HTML to PPTx if the html content is a result from converted result from Excel or Word
here is a attachment of some example
input.zip (2.5 KB)
the result
ouput.zip (44.9 KB)
we can see the extra text added on the top
image.png (28.2 KB)
Here is the code snippet we are using:
String temp = htmlContent.replace(Constant.RELATED_PATH_PREFIX, rootPath);
temp = temp.replace(Constant.RELATED_PATH_HTML, rootPath).replace(Constant.KEY_SRC + Constant.FILE_SEPARATOR,
Constant.KEY_SRC);
InputStream inputStream = new ByteArrayInputStream(temp.getBytes());
try {
lic.setLicense(Constant.LICENSE_LOCATION);
} catch (Exception e) {
return new ConvertResult(false, e.toString(), null, null, null);
}
Presentation presentation = new Presentation();
try {
presentation.getSlides().addFromHtml(inputStream);
presentation.save(fileAbsolutePath + fileName + Constant.EXTENSION_PPT, SaveFormat.Pptx);
} catch (Exception e) {
return new ConvertResult(false, e.toString(), null, null, null);
} finally {
presentation.dispose();
inputStream.close();
}
Please provide us some guidance about this, thanks!