Convert PowerPoint to HTML Using Java

This article will share how to convert PowerPoint documents to HTML format files using Free Spire.Presentation for Java.

Installation(2 Methods)
● Download the free API and unzip it. Then add the Spire.Presentation.jar file to your project as dependency.

● You can also add the jar dependency to your maven project by adding the following configurations to the pom.xml.

<repositories>
<repository>
<id>com.e-iceblue</id>
<name>e-iceblue</name>
<url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.presentation.free</artifactId>
<version>3.9.0</version>
</dependency>
</dependencies>

Below is a screenshot of the sample PowerPoint document.

Sample Code

import com.spire.presentation.FileFormat;
import com.spire.presentation.Presentation;

public class ToHtml {
public static void main(String[] args) throws Exception {

//Create a Presentation object
Presentation presentation = new Presentation();

//Load the sample document
presentation.loadFromFile("C:\\Users\\Administrator\\Desktop\\sample.pptx");

//Save the document to HTML format
presentation.saveToFile("C:\\Users\\Administrator\\Desktop\\ToHtml.html", FileFormat.HTML);
}
}