Parse PPT Formats in C++
Native and high performance PPT document parsing using server-side Aspose.Slides for C++ APIs, without the use of any software like Microsoft or Adobe PDF.
Parse PPT File Using C++
In order to parse PPT file, we’ll use
API which is a feature-rich, powerful and easy to use document parsing API for C++ platform. You can download its latest version directly, just open
package manager, search for Aspose.Slides.Cpp and install. You may also use the following command from the Package Manager Console.
Command
PM> Install-Package Aspose.Slides.Cpp
How to Parse PPT Files in C++
A basic document parsing with Aspose.Slides for C++ APIs can be done with just few lines of code.
Load PPT file.
Get an Array of ITextFrame objects of first slide.
Loop through the Array of TextFrames
Loop through paragraphs in current ITextFrame.
Loop through portions in the current IParagraph.
Display the text.
System Requirements
Aspose.Slides for C++ supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with C++ Runtime Environment for Windows 32 bit, Windows 64 bit and Linux 64 bit.
- Aspose.Slides for C++ DLL referenced in your project.
Parse PPT Files - C++
// Sample file path
const String sourceFilePath = u"SourcePath\sourceFile.ppt";
// Load the PPT file
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath);
// Get an Array of ITextFrame objects from the first slide
System::ArrayPtr<SharedPtr<ITextFrame>> textFramesSlideOne = SlideUtil::GetAllTextBoxes(presentation->get_Slides()->idx_get(0));
// Loop through the Array of TextFrames
for (int i = 0; i get_Length(); i++){
// Loop through paragraphs in current ITextFrame
for (SharedPtr<IParagraph> paragraph : textFramesSlideOne[i]->get_Paragraphs()){
// Loop through portions in the current IParagraph
for (SharedPtr<IPortion> portion : paragraph->get_Portions()){
// Display text
Console::WriteLine(portion->get_Text());
}
}
}
About Aspose.Slides for C++ API
Aspose.Slides API can be used to read, write, manipulate and convert Microsoft PowerPoint documents to PDF, XPS, HTML, TIFF, ODP and various other formats. One can create new files from scratch and save those in the relevant supported formats. Aspose.Slides is a standalone API for creating, parsing or manipulating presentations, slides and elements and it does not depend on any software like Microsoft or OpenOffice.Online PPT Parser Live Demos
PPT What is PPT File Format?
A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.
Read More