# Convert HTML to PPTX in Python

> Convert HTML content to PPTX in Python. Use the Aspose.Slides Python API to import HTML and save the generated slides as a PowerPoint presentation.

Source: https://products.aspose.com/slides/python-net/conversion/html-to-pptx/
Updated: 2026-07-23



## Convert HTML to PPTX using Aspose.Slides

[*Aspose.Slides for Python via .NET*](/slides/python-net/) lets you import supported HTML content into editable PowerPoint slides. Use `SlideCollection.add_from_html` to create slides from an HTML document, then call `Presentation.save` with `SaveFormat.PPTX` to write the result in the modern Office Open XML presentation format.

The generated presentation can contain text, images, and basic formatting imported from the HTML source. This workflow does not require Microsoft PowerPoint or another presentation application.

## Convert HTML to PPTX in Python

Create a `Presentation`, remove its default blank slide, import the HTML file, and save the generated slides as a PPTX presentation.

### Python code for converting HTML to PPTX

```python
with slides.Presentation() as presentation:
    presentation.slides.remove_at(0)

    with open("page.html", "rb") as html_stream:
        presentation.slides.add_from_html(html_stream)

    presentation.save("output.pptx", slides.export.SaveFormat.PPTX)
```

## How to convert HTML to PPTX in Python

These are the steps to convert HTML to PPTX in Python.

Install [*Aspose.Slides for Python via .NET*](/slides/python-net/).

Import the `aspose.slides` package in your Python module.

Create a `Presentation` and remove its default blank slide.

Open the source HTML file and pass its stream to `SlideCollection.add_from_html`.

Call `Presentation.save` with the output file path and `SaveFormat.PPTX`.

## Other Supported PowerPoint Conversions

- [JPG TO PPT](/slides/python-net/conversion/jpg-to-ppt/)
- [JPG TO PPTX](/slides/python-net/conversion/jpg-to-pptx/)
- [PNG TO PPT](/slides/python-net/conversion/png-to-ppt/)
- [PNG TO PPTX](/slides/python-net/conversion/png-to-pptx/)
- [PDF TO PPT](/slides/python-net/conversion/pdf-to-ppt/)
- [PDF TO PPTX](/slides/python-net/conversion/pdf-to-pptx/)
- [HTML TO PPT](/slides/python-net/conversion/html-to-ppt/)
