Convert Presentation to HTML in Aspose.Slides vs pptx4j

Aspose.Slides - Convert Presentation to HTML

HTML is one of several widely used format for exchanging data. Aspose.Slides for Java provides support for converting a presentation to HTML which is an embedded SVG.

The Save method exposed by the Presentation class can be used to convert the whole presentation into a HTML document.

Saving a PowerPoint presentation to HTML is a two-line process with Aspose.Slides for Java. Simply open the presentation and save it out to HTML.


 //Instantiate Presentation class that represents PPTX file

Presentation pres = new Presentation(dataDir + "presentation.pptx");

HtmlOptions htmlOpt = new HtmlOptions();


//Saving the presentation to HTML + "AsposeHTML.html", SaveFormat.Html, htmlOpt);

pptx4j - Convert Presentation to HTML

pptx4j module of docx4j allows to convert presentations to HTML format. Below available is the sample to show the method.


 String inputfilepath = dataDir + "pptx-basic.xml";

// Where to save images


PresentationMLPackage presentationMLPackage =


// TODO - render slides in document order!

Iterator partIterator = presentationMLPackage.getParts().getParts().entrySet().iterator();

while (partIterator.hasNext()) {

    Map.Entry pairs = (Map.Entry);

    Part p = (Part)pairs.getValue();

    if (p instanceof SlidePart) {


    			SvgExporter.svg(presentationMLPackage, (SlidePart)p)




// NB: file suffix must end with .xhtml in order to see the SVG in a browser

Download Running Code

Download Sample Code