deckmint
Create PowerPoint .pptx presentations programmatically in Rust. Works on native targets and compiles to WebAssembly for in-browser use.
Quick start
use ;
use TextOptionsBuilder;
use ShapeOptionsBuilder;
let mut pres = new;
pres.title = "My Presentation".to_string;
let slide = pres.add_slide;
slide.add_text;
slide.add_shape;
write.unwrap;
Equations
LaTeX equations are converted to native, editable Office Math (OMML). Enabled by default via the deckmint-math crate.
use Presentation;
use TextOptionsBuilder;
let mut pres = new;
let slide = pres.add_slide;
slide.add_equation.unwrap;
Grid layout
The built-in grid layout system provides CSS-grid-inspired positioning with flexible/fixed tracks, gaps, and nesting -- no manual coordinate math needed.
use ;
use ShapeOptionsBuilder;
use TextOptionsBuilder;
use ;
let mut pres = new;
let slide = pres.add_slide;
// Header + flexible content area + footer
let grid = new
.cols
.rows
.row_gap
.padding
.build;
slide.add_shape;
slide.add_text;
// Nest a 3-column grid inside the content cell
let cards = grid.sub_grid
.cols
.gap
.build;
for in
.iter.enumerate
WebAssembly
deckmint compiles to WASM via the deckmint-wasm crate, enabling PowerPoint generation directly in the browser with no server round-trip. See deckmint-wasm/demo/ for a working example that generates and downloads a .pptx from a button click.
# Build the WASM package and run the demo
# Open http://localhost:8080/demo/
Features
- Text -- rich text runs, bold/italic/underline (15 styles), alignment, RTL, bullets, superscript/subscript, glow, outline, hyperlinks, tab stops, text fit/wrap
- Shapes -- 150+ preset shapes, fill, line, shadow, rotation, flip, rounded corners, arrow heads, custom geometry
- Images -- PNG/JPEG/GIF/SVG, cover/contain/crop sizing, transparency, rounding, auto-dimension detection, base64 input
- Tables -- column widths, per-row heights, cell fill/color/font, alignment, margins, borders, colspan/rowspan, hyperlinks
- Charts -- bar, column, line, area, pie, doughnut, scatter, radar, bubble, stock, surface with data labels, legends, axis configuration
- Animations -- entrance/exit/emphasis effects with triggers, delays, sequencing, and click groups
- Slide masters -- background color/image, reusable objects, custom layouts, promote-from-slide
- Transitions -- 30+ types (fade, push, wipe, zoom, flash, morph, etc.) with speed and direction control
- Equations -- LaTeX math converted to native editable OMML via
deckmint-math - Grid layout -- CSS-grid-inspired positioning with
Fr/Inches/Percent/MinMaxtracks, gaps, padding, nesting - Connectors -- straight, elbow, and curved connectors between shapes
- Groups -- group multiple objects together
- Media -- embed video and audio
- Sections -- organize slides into named sections
- Speaker notes -- add notes to any slide
- 3D effects -- bevel presets, materials, camera angles, light rigs
- Pattern fills -- 43 pattern types with foreground/background colors
- WASM -- full browser support via
deckmint-wasm
Crates
| Crate | Description |
|---|---|
deckmint |
Core library |
deckmint-math |
LaTeX/MathML to OMML equation converter |
deckmint-wasm |
WebAssembly bindings |
Examples
There are 30+ examples covering every feature:
See deckmint/examples/ for the full list.
License
MIT
Acknowledgements
This project has learned from and been inspired by:
- PptxGenJS -- the original JavaScript PowerPoint generation library
- python-pptx -- Python library for creating PowerPoint files
- rust-pptx -- Rust PPTX reading/writing crate