Convert PPT to Word in C++
Render PowerPoint slides as images in Word using Aspose.Slides for C++ and Aspose.Words for C++.
Convert PowerPoint to Word in C++
Use this C++ code to convert PPT to Word:
PPT to Word C++ Conversion Source Code
auto presentation = MakeObject<Presentation>(u"presentation.ppt");
auto wordDocument = MakeObject<Aspose::Words::Document>();
auto documentBuilder = MakeObject<Aspose::Words::DocumentBuilder>(wordDocument);
auto slideSize = Size(1200, 800);
for (auto&& slide : presentation->get_Slides())
{
auto slideImage = slide->GetImage(slideSize);
auto imageStream = MakeObject<System::IO::MemoryStream>();
slideImage->Save(imageStream, Aspose::Slides::ImageFormat::Png);
imageStream->set_Position(0);
documentBuilder->InsertImage(imageStream);
imageStream->Dispose();
slideImage->Dispose();
documentBuilder->InsertBreak(Aspose::Words::BreakType::PageBreak);
}
wordDocument->Save(u"presentation.docx");
presentation->Dispose();Convert PowerPoint to Word Using Aspose.Slides and Aspose.Words
Aspose.Slides for C++ can render presentation slides as images, while Aspose.Words for C++ can insert those images into a Word document and save it in DOCX format.
How to Convert PPT to Word
- Install
Aspose.Slides for C++andAspose.Words for C++. - Create a
Presentationinstance from the source PPT file. - Create a Word
DocumentandDocumentBuilder. - Render slides with
GetImage, insert the slide images withDocumentBuilder, and save the result as DOCX.
Built with Aspose.Slides
Convert PPT to Word Online
The free Aspose.Slides Conversion app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own PPT files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides converts files before you write code.
- Upload PPT files and save them as Word.
- Download the result or convert more files.
Other Supported Conversions
You can also convert PowerPoint to files in other formats.