ppt-rs-0.1.0 has been yanked.
ppt-rs
A Rust library for creating, reading, and updating PowerPoint (.pptx) files.
This is a Rust port of the python-pptx library, providing a safe and efficient way to work with PowerPoint files in Rust.
Features
- ✅ Create new PowerPoint presentations
- ✅ Read existing .pptx files
- ✅ Modify slides, shapes, text, images, and charts
- ✅ Full support for OpenXML format (ISO/IEC 29500)
- ✅ Comprehensive shape support (AutoShape, Picture, Connector, GraphicFrame, GroupShape)
- ✅ Chart support with axes (CategoryAxis, ValueAxis, DateAxis)
- ✅ Table support with formatting options
- ✅ DrawingML support (colors, fills, lines)
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Quick Start
use new_presentation;
// Create a new presentation
let mut prs = new_presentation?;
// Get slides collection
let slides = prs.slides;
// Add a slide (when implemented)
// let slide = slides.add_slide(...)?;
// Save the presentation
prs.save_to_file?;
Architecture
graph TB
A[Presentation API] --> B[OPC Package]
B --> C[Parts]
C --> D[PresentationPart]
C --> E[SlidePart]
C --> F[ImagePart]
C --> G[ChartPart]
D --> H[OpenXML Processing]
E --> H
F --> H
G --> H
H --> I[XML Parser/Generator]
B --> J[ZIP Archive]
Status
🚧 Work in Progress - This library is currently under active development.
Current Status:
- ✅ Core OPC (Open Packaging Convention) support
- ✅ Parts module (all major parts implemented)
- ✅ Shapes module (AutoShape, Picture, Connector, GraphicFrame, GroupShape)
- ✅ Text module (TextFrame, Paragraph, Font)
- ✅ Table module
- ✅ Chart module (with axes support)
- ✅ DML (DrawingML) module
- ⚠️ XML serialization (in progress)
- ⚠️ Advanced features (placeholders, hyperlinks, effects)
Test Coverage: 69 tests passing
Documentation
Examples
Creating a Presentation
use new_presentation;
let mut prs = new_presentation?;
// ... add slides, shapes, etc.
prs.save_to_file?;
Working with Shapes
use ;
let mut shape = new;
shape.set_width; // 1 inch in EMU
shape.set_height;
Working with Charts
use ;
let mut chart = new;
chart.set_has_title;
chart.title_mut.unwrap.set_text;
let cat_axis = chart.category_axis_mut;
cat_axis.set_has_title;
let val_axis = chart.value_axis_mut;
val_axis.set_minimum_scale;
val_axis.set_maximum_scale;
Requirements
- Rust 1.70 or later
- Rust edition 2024
License
Licensed under the Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
This library is a port of python-pptx by Steve Canny. Many thanks for the excellent reference implementation.