# Convert PDF to HTML in Python

> Convert PDF files to HTML in Python. Use the Aspose.Slides Python API to import PDF pages and publish them as a self-contained HTML document.

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



## Convert PDF to HTML in Python

[*Aspose.Slides for Python via .NET*](/slides/python-net/) lets you import PDF pages into a presentation and publish the result as HTML. The API provides `SlideCollection.add_from_pdf` for importing PDF content and `Presentation.save` with `SaveFormat.HTML` for creating the output document.

Each PDF page becomes a slide in the presentation before the presentation is exported as a self-contained HTML file. This workflow does not require Microsoft PowerPoint, Adobe Acrobat, or another presentation application.

## Convert PDF to HTML using Python

Create a `Presentation`, remove its default blank slide, import the PDF pages, and save the presentation with `SaveFormat.HTML`.

### Python code for converting PDF into HTML

```python
with slides.Presentation() as presentation:
    presentation.slides.remove_at(0)
    presentation.slides.add_from_pdf("document.pdf")
    presentation.save("document.html", slides.export.SaveFormat.HTML)
```

## How to Convert PDF to HTML Using the Aspose.Slides Python API

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

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

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

Import the source PDF by using `SlideCollection.add_from_pdf`.

Call `Presentation.save` with the output path and `SaveFormat.HTML`.

## Convert PDF to Other Supported Formats

- [PDF TO IMAGE](/slides/python-net/conversion/pdf-to-image/)
- [PDF TO JPG](/slides/python-net/conversion/pdf-to-jpg/)
- [PDF TO PNG](/slides/python-net/conversion/pdf-to-png/)
- [PDF TO TIFF](/slides/python-net/conversion/pdf-to-tiff/)
- [PDF TO XML](/slides/python-net/conversion/pdf-to-xml/)
- [PDF TO SVG](/slides/python-net/conversion/pdf-to-svg/)
- [PDF TO PPTX](/slides/python-net/conversion/pdf-to-pptx/)
- [PDF TO PPT](/slides/python-net/conversion/pdf-to-ppt/)
