Export to HTML5
Info
In Aspose.Slides 21.9, we implemented support for HTML5 export. However, if you prefer to export your PowerPoint to HTML using WebExtensions, see this article instead.The export to HTML5 process here allows you to convert PowerPoint to HTML without web extensions or dependencies. This way, using your own templates, you can apply very flexible options that define the export process and the resulting HTML, CSS, JavaScript, and animation attributes.
Export PowerPoint to HTML5
This python code shows how you to export a presentation to HTML5 without web extensions and dependencies:
import aspose.slides as slides
with slides.Presentation("pres.pptx") as presentation:
presentation.save("index.html", slides.export.SaveFormat.HTML5)
You may want to specify the settings for shape animations and slide transitions this way:
import aspose.slides as slides
with slides.Presentation("pres.pptx") as presentation:
options = slides.export.Html5Options()
options.animate_shapes = False
options.animate_transitions = False
presentation.save("index.html", slides.export.SaveFormat.HTML5, options)
Export PowerPoint to HTML
This python code demonstrates the standard PowerPoint to HTML process:
import aspose.slides as slides
with slides.Presentation("pres.pptx") as presentation:
presentation.save("index.html", slides.export.SaveFormat.HTML)
In this case, the presentation content is rendered through SVG in a form like this:
<body>
<div class="slide" name="slide" id="slideslideIface1">
<svg version="1.1">
<g> THE SLIDE CONTENT GOES HERE </g>
</svg>
</div>
</body>
Note
When you use this method to export PowerPoint to HTML, due to the SVG rendering, you will not be able to apply styles or animate specific elements.Export PowerPoint to HTML5 Slide View
Aspose.Slides allows you to convert a PowerPoint presentation to an HTML5 document in which the slides are presented in a slide view mode. In this case, when you open the resulting HTML5 file in a browser, you see the presentation in slide view mode on a web page.
This Python code demonstrates the PowerPoint to HTML5 Slide View export process:
import aspose.slides as slides
with slides.Presentation("pres.pptx") as pres:
# Export a presentation containing slides transitions, animations, and shapes animations to HTML5
options = slides.export.Html5Options()
options.animate_shapes = True
options.animate_transitions = True
# Save presentation
pres.save("HTML5-slide-view.html", slides.export.SaveFormat.HTML5, options)