Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active May 30, 2022 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blog-aspose-cloud/23a050132c31fc472a7327dbcc2cd141 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/23a050132c31fc472a7327dbcc2cd141 to your computer and use it in GitHub Desktop.
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

try
{
// Get ClientID and ClientSecret from https://dashboard.aspose.cloud/
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) {
contentBuilder.append(str);
}
in.close();
} 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)
{
System.out.println(ex.getStackTrace());
}
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