Menu

Convert Presentation to HTML

Shoaib

Aspose.Slides - Convert Presentation to HTML

//Instantiate Presentation class that represents PPTX file
Presentation pres = new Presentation(dataPath + "presentation.pptx");

HtmlOptions htmlOpt = new HtmlOptions();
htmlOpt.setHtmlFormatter(HtmlFormatter.createDocumentFormatter("",false));

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

Download Download Example Code

Pptx4j

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

// Where to save images
SvgExporter.setImageDirPath(dataPath);

PresentationMLPackage presentationMLPackage = 
    (PresentationMLPackage)PresentationMLPackage.load(new java.io.File(inputfilepath));     

// TODO - render slides in document order!
Iterator partIterator = presentationMLPackage.getParts().getParts().entrySet().iterator();
while (partIterator.hasNext()) {

    Map.Entry pairs = (Map.Entry)partIterator.next();

    Part p = (Part)pairs.getValue();
    if (p instanceof SlidePart) {

        System.out.println(
                SvgExporter.svg(presentationMLPackage, (SlidePart)p)
                );
    }
}

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

Download Download Example Code


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.