Aspose Java for Docx4j Wiki
Aspose - Your File Format Expert
Status: Abandoned
Brought to you by:
asposemp
//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);
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