Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Insert Webpage into PowerPoint

Embedding HTML in PowerPoint

This Gist shares details on how to insert webpage into powerpoint PowerPoint using Aspose.Slides Cloud SDK for Java.

In following code snippet, we are loading HTML file into String instance and embedding html in powerpoint using ImportFromHtml(…) method. The resultant PPT is saved in Cloud storage. For complete details, please visit Insert Webpage into PowerPoint using Java.

HTML to PPT in Java

Important Links

Home | Product Page | Docs | API Reference | Cloud Dashboard | Code Samples | Source Code | Blog | Free Support | Free Trial

// Get ClientID and ClientSecret from
String clientId = "bbf94a2c-6d7e-4020-b4d2-b9809741374e";
String clientSecret = "1c9379bb7d701c26cc87e741a29987bb";
// create an instance of SlidesApi
SlidesApi slidesApi = new SlidesApi(clientId,clientSecret);
// create StringBuilder object
StringBuilder contentBuilder = new StringBuilder();
try {
// read content of input HTML file
BufferedReader in = new BufferedReader(new FileReader("c://Users/Downloads/test.html"));
String str;
while ((str = in.readLine()) != null) {
} catch (IOException e) {
// convert loaded HTML content to String instance
String content = contentBuilder.toString();
// call method to insert webpage into PowerPoint
slidesApi.importFromHtml("Resultant.ppt",content, "", "", "Internal");
// print success message
System.out.println("Sucessfully completed embedding html in powerpoint !");
}catch(Exception ex)
Insert Webpage into PowerPoint using Aspose.Slides Cloud SDK for Java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment