# Convert PPTX to Word in Python

> Convert PPTX presentation slides to Word documents in Python. Use Aspose.Slides and Aspose.Words to create a DOCX file from a PowerPoint presentation.

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



## Convert PowerPoint to Word using Aspose.Slides and Aspose.Words

[**Aspose.Slides for Python via .NET**](/slides/python-net/) and [**Aspose.Words for Python via .NET**](/words/python-net/) let you process PowerPoint presentations and Word documents programmatically. To convert a PPTX file to Word, render each slide by using `Slide.get_image`, insert the resulting image into a document with `DocumentBuilder.insert_image`, and save the document in DOCX format.

## Convert PowerPoint to Word in Python

The following example converts every slide in a PPTX presentation to a full-page image in a Word document.

### Python code for converting PowerPoint to Word

```python
with slides.Presentation("presentation.pptx") as presentation:
    document = words.Document()
    document_builder = words.DocumentBuilder(document)

    slide_size = presentation.slide_size.size
    document_builder.page_setup.page_width = slide_size.width
    document_builder.page_setup.page_height = slide_size.height
    document_builder.page_setup.left_margin = 0
    document_builder.page_setup.right_margin = 0
    document_builder.page_setup.top_margin = 0
    document_builder.page_setup.bottom_margin = 0

    image_scale = 2
    slide_count = len(presentation.slides)

    for slide_index, slide in enumerate(presentation.slides):
        with slide.get_image(image_scale, image_scale) as slide_image:
            with io.BytesIO() as image_stream:
                slide_image.save(image_stream, slides.ImageFormat.PNG)
                image_data = image_stream.getvalue()

        page_width = document_builder.page_setup.page_width
        page_height = document_builder.page_setup.page_height
        document_builder.insert_image(image_data, page_width, page_height)

        if slide_index < slide_count - 1:
            document_builder.insert_break(words.BreakType.PAGE_BREAK)

    document.save("presentation.docx")
```

## How to convert PPTX to Word

Install **Aspose.Slides for Python via .NET** and **Aspose.Words for Python via .NET**.

Load the PPTX file into a `Presentation` instance, and create `Document` and `DocumentBuilder` instances.

Match the Word page size and margins to `Presentation.slide_size`.

Render each `Slide` by using `Slide.get_image`.

Insert each rendered image by using `DocumentBuilder.insert_image`, adding page breaks between slides.

Save the resulting DOCX file by using `Document.save`.

## Other Supported Conversions

- [PPTX TO HTML](/slides/python-net/conversion/pptx-to-html/)
- [PPTX TO JPEG](/slides/python-net/conversion/pptx-to-jpg/)
- [PPTX TO PNG](/slides/python-net/conversion/pptx-to-png/)
- [PPTX TO SVG](/slides/python-net/conversion/pptx-to-svg/)
- [PPTX TO BMP](/slides/python-net/conversion/pptx-to-bmp/)
- [PPTX TO EMF](/slides/python-net/conversion/pptx-to-emf/)
- [PPTX TO GIF](/slides/python-net/conversion/pptx-to-gif/)
