Skip to main content

Crate ooxml_pml

Crate ooxml_pml 

Source
Expand description

PresentationML (PPTX) support for the ooxml library.

This crate provides reading and writing of PowerPoint presentations (.pptx files).

§Reading Presentations

use ooxml_pml::{Presentation, ShapeExt};

let mut pres = Presentation::open("presentation.pptx")?;
println!("Slides: {}", pres.slide_count());
for slide in pres.slides()? {
    println!("Slide: {}", slide.index());
    for shape in slide.shapes() {
        if let Some(text) = shape.text() {
            println!("  Text: {}", text);
        }
    }
}

§Writing Presentations

use ooxml_pml::PresentationBuilder;

let mut pres = PresentationBuilder::new();
let slide = pres.add_slide();
slide.add_title("Hello World");
slide.add_text("Created with ooxml-pml");
pres.save("output.pptx")?;

Re-exports§

pub use generated as types;
pub use generated_parsers as parsers;
pub use generated_serializers as serializers;
pub use error::Error;
pub use error::Result;
pub use presentation::SmartArtParts;
pub use presentation::DiagramRelIds;
pub use presentation::ImageData;
pub use presentation::Presentation;
pub use presentation::Slide;
pub use presentation::SlideLayout;
pub use presentation::SlideLayoutType;
pub use presentation::SlideMaster;
pub use presentation::Table;
pub use presentation::Transition;
pub use presentation::TransitionSpeed;
pub use presentation::TransitionType;
pub use types::Picture;
pub use types::Shape;
pub use writer::GroupBuilder;
pub use writer::ImageFormat;
pub use writer::Paragraph;
pub use writer::PresentationBuilder;
pub use writer::PresetGeometry;
pub use writer::ShapeBuilder;
pub use writer::SlideBuilder;
pub use writer::SlideTransition;
pub use writer::TableBuilder;
pub use writer::TextAlign;
pub use writer::TextRun;
pub use ext::NotesSlideExt;
pub use ext::CommonSlideDataExt;
pub use ext::ConnectorExt;
pub use ext::GraphicalObjectFrameExt;
pub use ext::GroupShapeExt;
pub use ext::PictureExt;
pub use ext::ShapeExt;
pub use ext::SlideExt;
pub use ext::SlideLayoutExt;
pub use ext::SlideMasterExt;

Modules§

error
Error types for PresentationML parsing and writing.
ext
Extension traits for generated PML types.
generated
Generated types from the ECMA-376 PresentationML schema.
generated_parsers
Generated FromXml parsers for all generated types.
generated_serializers
Generated ToXml serializers for all generated types.
presentation
Presentation API for reading and writing PowerPoint files.
writer
PowerPoint presentation writing support.

Structs§

CTTable
CTTableCell
CTTableRow

Traits§

TableCellExt
Extension trait for CTTableCell providing convenience methods.
TableExt
Extension trait for CTTable providing convenience methods.
TableRowExt
Extension trait for CTTableRow providing convenience methods.