
Aspose.Slides FOSS for C++
Open Source C++ API That Simplifies PowerPoint Automation
Learn How Aspose.Slides FOSS for C++ Simplifies PowerPoint Automation. Explore Features, Code Examples, and Practical Use Cases for Creating and Manipulating PPT and PPTX Files.
What is Aspose.Slides FOSS for C++?
Automating PowerPoint presentation engineering within native desktop or backend services has traditionally presented significant challenges for C++ developers. The reliance on heavy COM automation, third-party wrappers, or restrictive cloud APIs frequently introduces unwanted runtime overhead and deployment complexity. Aspose.Slides FOSS for C++ introduces a compelling alternative. It is an official, open-source, and MIT-licensed C++ library explicitly designed to create, read, manipulate, and save PowerPoint .pptx presentations natively. Built to leverage the performance advantages of modern C++20, this lightweight framework operates independently of Microsoft PowerPoint or any external office suites. By eliminating commercial licensing hurdles for standard presentation input/output workflows, it provides developers with a transparent, ecosystem-friendly path to managing slide layouts, shapes, geometries, text typography, and document properties directly within high-performance applications.
Aspose.Slides FOSS for C++ is an open-source collection of examples, helper classes, and sample applications that demonstrate how to use Aspose.Slides FOSS for C++ effectively. The project helps developers quickly learn PowerPoint automation by providing well-structured source code covering common presentation processing tasks. Instead of reading lengthy documentation and building everything from scratch, developers can reuse proven examples and customize them according to project requirements. The library supports both Windows and Linux environments, making it suitable for cross-platform C++ applications.
Getting Started with Aspose.Slides FOSS for C++
The recommend way to install Aspose.Slides FOSS for C++ is using GitHub. Please use the following command for a smooth installation.
Install Aspose.Slides FOSS for C++ via NuGGitHubet
git clone https://github.com/aspose-slides-foss/Aspose.Slides-FOSS-for-Cpp.git You can also download it directly from Aspose product release page.Create PowerPoint Presentations from Scratch via C++
One of the most valuable capabilities of Aspose.Slides FOSS for C++ is creating completely new PowerPoint presentations programmatically. Instead of designing slides manually, developers can generate presentations dynamically using application data, reports, invoices, dashboards, or customer information. This feature is especially useful for automated reporting systems, business intelligence applications, and enterprise software where presentations are generated on demand. Since every slide is created through code, developers gain full control over the presentation structure and content. Here is a simple example that creates a new PowerPoint presentation and saves it as a PPTX file.
How to Creates a New PowerPoint Presentation and Saves It As a PPTX via C++?
#include
using namespace Aspose::Slides;
int main()
{
auto presentation = System::MakeObject();
presentation->Save(u"NewPresentation.pptx",
Export::SaveFormat::Pptx);
return 0;
}
Convert PowerPoint Presentations to PDF via C++
Many organizations distribute presentations as PDF documents to ensure consistent viewing across different devices. Aspose.Slides FOSS for C++ demonstrates how to convert PowerPoint files into high-quality PDF documents with minimal code. PDF conversion is particularly useful for archiving presentations, sharing reports with clients, printing handouts, and preserving document formatting. Automated conversion also removes the need for Microsoft PowerPoint during server-side processing. The following example converts a PowerPoint presentation into a PDF document using C++ commands.
How to Converts a PowerPoint Presentation into a PDF Document via C++
#include
using namespace Aspose::Slides;
int main()
{
auto presentation =
System::MakeObject(u"Presentation.pptx");
presentation->Save(
u"Presentation.pdf",
Export::SaveFormat::Pdf
);
return 0;
}
Add and Format Text on Slides
Generating presentations usually involves inserting dynamic text such as titles, summaries, statistics, or customer information. Aspose.Slides FOSS for C++ makes this process straightforward by allowing developers to add text boxes and apply professional formatting. Software developers can customize font size, font family, colors, alignment, paragraph spacing, and positioning. This makes it possible to generate visually appealing presentations without manual editing, ensuring consistent branding across automatically generated documents.
How to Inserts a Text Box Onto The First Slide via C++ Library?
#include
#include
using namespace Aspose::Slides;
int main()
{
auto presentation = System::MakeObject();
auto slide = presentation->get_Slides()->idx_get(0);
auto shape = slide->get_Shapes()->AddAutoShape(
ShapeType::Rectangle,
100,
100,
400,
80
);
shape->get_TextFrame()->set_Text("Welcome to Aspose.Slides!");
presentation->Save(u"TextExample.pptx",
Export::SaveFormat::Pptx);
return 0;
}
Insert Images into Presentations via C++ API
Visual elements make presentations more engaging and informative. Aspose.Slides FOSS for C++ enables developers to insert logos, photographs, diagrams, charts, icons, and screenshots programmatically. Applications generating business reports or marketing presentations can automatically embed company branding and data visualizations without requiring manual editing. This feature is ideal for automated presentation generation workflows where images are retrieved from databases or external services.
How to Inserts an Image Onto PowerPoint Slide via C++ API?
#include
using namespace Aspose::Slides;
int main()
{
auto presentation = System::MakeObject();
auto slide = presentation->get_Slides()->idx_get(0);
auto image = Images::Image::FromFile(u"logo.png");
auto img = presentation->get_Images()->AddImage(image);
slide->get_Shapes()->AddPictureFrame(
ShapeType::Rectangle,
100,
100,
250,
150,
img
);
presentation->Save(u"ImagePresentation.pptx",
Export::SaveFormat::Pptx);
return 0;
}
