Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active December 30, 2021 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/223609d1fb2c102aac36f1c4707834bb to your computer and use it in GitHub Desktop.
Save aspose-com-gists/223609d1fb2c102aac36f1c4707834bb to your computer and use it in GitHub Desktop.
Convert PowerPoint PPT or PPTX to HTML in Python
import aspose.slides as slides
# Load the presentation file
pres = slides.Presentation("presentation.pptx")
# Create HTML options
options = slides.export.HtmlOptions()
# Include slide notes
options.notes_comments_layouting.notes_position = slides.export.NotesPositions.BOTTOM_FULL
# Save as HTML
pres.save("ppt-to-html-notes.html", slides.export.SaveFormat.HTML, options)
import aspose.slides as slides
# Load the presentation file
pres = slides.Presentation("presentation.pptx")
# Save as HTML
pres.save("ppt-to-html.html", slides.export.SaveFormat.HTML)
import aspose.slides as slides
# Load the presentation file
pres = slides.Presentation("presentation.pptx")
# Create HTML options
options = slides.export.HtmlOptions()
# Create a responsive HTML controller
controller = slides.export.ResponsiveHtmlController()
# Set controller as HTML formatter
options.html_formatter = slides.export.HtmlFormatter.create_custom_formatter(controller)
# Save as HTML
pres.save("ppt-to-responsive-html.html", slides.export.SaveFormat.HTML, options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment