Parse PPT Presentations in C++

Use Aspose.Slides for C++ to extract text from presentation slides without Microsoft PowerPoint.

Parse PPT File Using C++

Use Aspose.Slides for C++ to parse PPT 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.Cpp

Parse PPT Files - C++

auto presentation = MakeObject<Presentation>(u"presentation.ppt");
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 PPT Files in C++

Extract text from PPT files with Aspose.Slides for C++.

  1. Load the PPT file with the Presentation class.
  2. Get the ITextFrame objects from the first slide with SlideUtil::GetAllTextBoxes.
  3. Loop through the ITextFrame objects.
  4. Loop through the IParagraph objects in each ITextFrame.
  5. Loop through the IPortion objects in each IParagraph.
  6. 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 PPT files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides reads your files before you write code.
  • Upload your PPT file and get its text and images.
  • Download everything as one ZIP archive.

What is PPT File Format?

A PPT file is a Microsoft PowerPoint 97-2003 presentation file. It stores slides, text, images, multimedia, and embedded objects in the binary PowerPoint file format used before the Open XML PPTX format.

Read More

Other Supported Parsing Formats

You can also parse other presentation formats with C++.