Introduction
Aspose.Slides FOSS for C++ is now available: a free, MIT-licensed library for creating, reading, and editing PowerPoint .pptx files in native C++, with no dependency on Microsoft Office or any proprietary runtime.
The library is designed for developers who need to generate or manipulate presentation files programmatically: automating slide decks from data, extracting text and metadata from uploaded PPTX files, building presentation-based reporting pipelines, or embedding presentation creation into desktop and server applications. Because aspose_slides_foss is built with CMake, it compiles and deploys on Windows, macOS, and Linux.
Key Features
- Full round-trip PPTX support: Open any
.pptxfile, modify its content, and save it back without losing unknown XML parts that the library does not yet understand. - Slides management: Add, remove, and iterate slides using
prs.slides(); the presentation starts with one blank slide after constructing aPresentation. - AutoShapes, Tables, and Connectors: Insert shapes via
slide.shapes().add_auto_shape(), tabular data viaslide.shapes().add_table(), and visual connectors between shapes viaslide.shapes().add_connector(). - Rich text formatting: Format text at character level with
PortionFormat: font size, bold, italic, underline, and ARGB color viaFillType::SolidandColorFormat. - Fill types: Apply
FillType::Solid,Gradient,Pattern, orPicturefills to any shape. - Visual effects: Outer shadow, glow, soft edge, blur, reflection, and inner shadow via
shape.effect_format(). - 3D formatting: Bevel, camera, light rig, material, and extrusion depth via
shape.three_d_format(). - Speaker notes: Attach notes text to each slide via
notes_slide_manager().add_notes_slide(). - Threaded comments: Add comments with author metadata and slide position.
- Embedded images: Embed from file path, memory buffer, or stream.
- Document properties: Read and write core, app, and custom properties.
Getting Started
Add the library via CMake. A C++17 compiler is required.
include(FetchContent)
FetchContent_Declare(
aspose_slides_foss
GIT_REPOSITORY https://github.com/aspose-slides/Aspose.Slides-FOSS-for-Cpp.git
GIT_TAG main
)
FetchContent_MakeAvailable(aspose_slides_foss)
target_link_libraries(your_target PRIVATE aspose_slides_foss)
Create your first presentation with a shape and save it:
#include <Aspose/Slides/Foss/presentation.h>
int main() {
using namespace Aspose::Slides::Foss;
Presentation prs;
auto& slide = prs.slides()[0];
auto& shape = slide.shapes().add_auto_shape(
ShapeType::Rectangle, 50, 50, 400, 120
);
shape.add_text_frame("Hello from Aspose.Slides FOSS!");
prs.save("hello.pptx");
return 0;
}
The Presentation destructor releases all internal resources automatically when it goes out of scope.
Text Formatting Example
#include <Aspose/Slides/Foss/presentation.h>
using namespace Aspose::Slides::Foss;
Presentation prs;
auto& shape = prs.slides()[0].shapes().add_auto_shape(
ShapeType::Rectangle, 50, 50, 500, 150
);
auto& tf = shape.add_text_frame("Bold heading in corporate blue");
auto& fmt = tf.paragraphs()[0].portions()[0].portion_format();
fmt.set_font_height(28);
fmt.set_font_bold(NullableBool::TRUE);
fmt.fill_format().set_fill_type(FillType::Solid);
fmt.fill_format().solid_fill_color().set_color(Color::from_argb(255, 0, 70, 127));
prs.save("formatted.pptx");
Current Limitations
The following areas throw exceptions in this release:
- Charts, SmartArt, and OLE objects
- Animations and slide transitions
- Export to PDF, HTML, SVG, or image formats
- Hyperlinks, action settings, VBA macros, and digital signatures
Unknown XML parts encountered during load are preserved verbatim on save, so PPTX files produced by other tools round-trip safely.