Parse PPTX Presentations in C++
Use Aspose.Slides for C++ to extract text from presentation slides without Microsoft PowerPoint.
Parse PPTX File Using C++
Use Aspose.Slides for C++ to parse PPTX presentation files and extract text from slides. The API exposes slide text through SlideUtil::GetAllTextBoxes, ITextFrame, IParagraph, and IPortion, so you can read text content without automating Microsoft PowerPoint. Install the
Aspose.Slides.Cpp
package from NuGet or use the Package Manager Console command below.
Command
PM> Install-Package Aspose.Slides.CppParse PPTX Files - C++
auto presentation = MakeObject<Presentation>(u"presentation.pptx");
auto textFrames = SlideUtil::GetAllTextBoxes(presentation->get_Slide(0));
for (auto&& textFrame : textFrames)
{
for (auto&& paragraph : textFrame->get_Paragraphs())
{
for (auto&& portion : paragraph->get_Portions())
{
Console::WriteLine(portion->get_Text());
}
}
}
presentation->Dispose();How to Parse PPTX Files in C++
Extract text from PPTX files with Aspose.Slides for C++.
- Load the PPTX file with the
Presentationclass. - Get the
ITextFrameobjects from the first slide withSlideUtil::GetAllTextBoxes. - Loop through the
ITextFrameobjects. - Loop through the
IParagraphobjects in eachITextFrame. - Loop through the
IPortionobjects in eachIParagraph. - Read the text with
get_Text.
System Requirements
Aspose.Slides for C++ supports major desktop and server platforms. Make sure that your project has the following prerequisites.
- Microsoft Windows, Linux, macOS, or another compatible OS with the supported C++ runtime.
- Aspose.Slides for C++ library referenced in your project.
Built with Aspose.Slides
Extract Text and Images Online
The free Aspose.Slides Parser 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 PPTX files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides reads your files before you write code.
- Upload your PPTX file and get its text and images.
- Download everything as one ZIP archive.
What is PPTX File Format?
A PPTX file is a Microsoft PowerPoint Open XML presentation file. It stores slides, text, images, formatting, animations, and other presentation content in a zipped XML-based package.
Other Supported Parsing Formats
You can also parse other presentation formats with C++.