You can import the HTML document to a presentation. You should use the AddFromHtml method from the ISlideCollection interface as shown below:
var presentation = new Presentation();
var htmlStream = new FileInputStream("example.html");
presentation.getSlides().addFromHtml(htmlStream);
presentation.save("output.pptx", SaveFormat.Pptx);
presentation.dispose();
I have tried the above approach but its only but the output presentation only contains text but does not have images. I have attached the html file I am using.Untitled-1.zip (481 Bytes)
@rgutta,
I’ve reproduced the problem with missing the image when importing the HTML document to a presentation and added a ticket with ID SLIDESJAVA-39091 to our issue-tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when a new release of Aspose.Slides with a fix is published.
The issues you found earlier (filed as SLIDESJAVA-39091) have been fixed in Aspose.Slides for Java 23.7 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.