Convert PowerPoint to Word
Contents
[
Hide
]
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.
You may want to try out our Presentation to Word Online Converter to see what you could gain from working with textual content from slides.
Aspose.Slides and Aspose.Words
To convert a PowerPoint file (PPTX or PPT) to Word (DOCX or DOCX), you need both Aspose.Slides for PHP via 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
- Download Aspose.Slides for PHP via Java and Aspose.Words for Java libraries.
- Add aspose-slides-x.x-jdk16.jar and aspose-words-x.x-jdk16.jar to your CLASSPATH.
- Use this code snippet to convert the PowerPoint to Word:
$pres = new Presentation($inputPres);
try {
$doc = new Document();
$builder = new DocumentBuilder($doc);
foreach($pres->getSlides() as $slide) {
# generates and inserts slide image
$bitmap = $slide->getThumbnail(1, 1);
$builder->insertImage($bitmap);
# inserts slide's texts
foreach($slide->getShapes() as $shape) {
if (java_instanceof($shape, new JavaClass("com.aspose.slides.AutoShape"))) {
$builder->writeln($shape->getTextFrame()->getText());
}
}
$builder->insertBreak(BreakType::PAGE_BREAK);
}
$doc->save($outputDoc);
} finally {
if (!java_is_null($pres)) {
$pres->dispose();
}
}