Convert PowerPoint to Word

If you plan to use textual content or information from a presentation (PPT or PPTX) in new ways, you may benefit from converting the presentation to Word (DOC or DOCX).

  • When compared to Microsoft PowerPoint, the Microsoft Word app is more equipped with tools or functionalities for content.
  • Besides the editing functions in Word, you may also benefit from enhanced collaboration, printing, and sharing features.

Aspose.Slides and Aspose.Words

To convert a PowerPoint file (PPTX or PPT) to Word (DOCX or DOCX), you need both Aspose.Slides for Java and Aspose.Words for Java.

As a standalone API, Aspose.Slides for java provides functions that allow you to extract texts from presentations.

Aspose.Words is an advanced document processing API that allows applications to generate, modify, convert, render, print files, and perform other tasks with documents without utilizing Microsoft Word.

Convert PowerPoint to Word

  1. Download Aspose.Slides for Java and Aspose.Words for Java libraries.
  2. Add aspose-slides-x.x-jdk16.jar and aspose-words-x.x-jdk16.jar to your CLASSPATH.
  3. Use this code snippet to convert the PowerPoint to Word:
Presentation pres = new Presentation(inputPres);
try {
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    for (ISlide slide : pres.getSlides())
    {
        // generates and inserts slide image
        BufferedImage bitmap = slide.getThumbnail(1, 1);

        builder.insertImage(bitmap);

        // inserts slide's texts
        for (IShape shape : slide.getShapes())
        {
            if (shape instanceof AutoShape)
            {
                builder.writeln(((AutoShape)shape).getTextFrame().getText());
            }
        }

        builder.insertBreak(BreakType.PAGE_BREAK);
    }
    doc.save(outputDoc);
} finally {
    if (pres != null) pres.dispose();
}