Skip to main content

Crate pptxboss_core

Crate pptxboss_core 

Source
Expand description

PresentationML (.pptx) reader written from the ECMA-376 specification.

The crate is layered. zip reads the container through a positioned source so only the parts a caller opens are ever read. Package is the raw Open Packaging Conventions view: every ZIP item, content type and relationship exactly as written, defects included, so a verifier can see them. Document sits on top and is lenient: it resolves the presentation, its slides and their text, recovering from damaged packages where the structure still allows it and reporting what it skipped.

Re-exports§

pub use chart::ChartData;
pub use chart::Series;
pub use comments::Comment;
pub use comments::CommentAuthor;
pub use diagram::DiagramData;
pub use diagram::DiagramItem;
pub use document::Document;
pub use document::DocumentSeed;
pub use document::ImageRef;
pub use document::ObjectRef;
pub use document::Slide;
pub use document::SlideRef;
pub use document::SlideSection;
pub use error::Error;
pub use error::Result;
pub use markdown::MarkdownOptions;
pub use model::Content;
pub use model::Paragraph;
pub use model::Run;
pub use model::Shape;
pub use model::SlideContent;
pub use model::TextBody;
pub use package::Package;
pub use package::PackageDefects;
pub use package::PackageSeed;
pub use package::Part;
pub use presentation::Presentation;
pub use presentation::Section;
pub use properties::AppProperties;
pub use properties::CoreProperties;
pub use slide::SlideReport;
pub use text::ExtractReport;
pub use text::TextOptions;

Modules§

cfb
Compound File Binary containers (MS-CFB): the OLE storage behind legacy .ppt files and encrypted packages. The reader materializes the FAT, directory and mini stream once and serves streams by path, tolerating the header and chain defects the specification tells readers to expect. The writer produces a minimal version-3 file for fixtures and encrypted output.
chart
Chart text: the title, axis titles, series names, categories and values cached in a DrawingML chart part (ECMA-376 Part 1, clause 21.2) or in the 2014 extended chart part (cx:chartSpace). Values come back as written; nothing is computed or formatted.
comments
Slide comments: the PresentationML Comments part (ECMA-376 Part 1, clause 19.4, p:cmLst) with its Comment Authors part, and the 2018 comments part current PowerPoint writes (p188:cmLst, threaded replies, rich text) with its Authors part.
crc32
CRC-32 as used by ZIP (IEEE 802.3 polynomial 0x04C11DB7, reflected), computed eight bytes per step with a slicing-by-8 table.
diagram
SmartArt text: the data model of a DrawingML diagram (ECMA-376 Part 1, clause 21.4). Points of type doc root the tree, untyped points are the nodes, asst points are assistants; presentation, parent- and sibling-transition points carry layout only. Untyped connections (parOf) give the hierarchy and srcOrd the order.
document
The lenient document layer: a presentation located through the package relationships, its slides in sldIdLst order, and their content.
encoding
Transcoding of UTF-16 XML parts to UTF-8 (ECMA-376 Part 2 allows both encodings for XML parts; every parser in this crate reads UTF-8).
error
The crate’s error type.
hash
A fast, non-cryptographic hasher for the short keys the reader hashes in bulk: ZIP item names, part names, relationship ids and XML names. The standard library’s SipHash is DoS-resistant and far slower than needed for in-process maps over already-parsed input.
inflate
A DEFLATE decoder (RFC 1951) for buffers held whole in memory: the compressed bytes of a ZIP entry, decoded in one call into a Vec.
markdown
Markdown rendering of a deck: one ## heading per slide, bullets with their levels, GFM tables, images, chart tables, diagram outlines, and speaker notes and comments as block quotes on request.
mce
Element iteration with Markup Compatibility and Extensibility applied (ECMA-376 Part 3, clause 9). An mc:AlternateContent is replaced by its first mc:Choice whose Requires prefixes all name namespaces this reader understands, else by its mc:Fallback, else dropped. Every other element in the compatibility namespace is skipped.
model
The slide content model: the shape tree of a slide-family part with its text bodies, pictures, tables and groups (ECMA-376 Part 1, 19.3 and 21.1). Only what a reader needs to extract content and structure is kept; formatting beyond run-level emphasis is not modelled.
opc
Open Packaging Conventions (ECMA-376 Part 2): part names, the content types stream and relationships.
package
The raw Open Packaging Conventions view of a ZIP package (ECMA-376 Part 2, clause 7): every item mapped to a part name, the content types stream, and relationships parsed on demand.
pml
PresentationML part identities (ECMA-376 Part 1, clause 13; Part 4, clause 11): content types and relationship types, with both the Transitional and Strict relationship URIs recognized.
ppt
Legacy PowerPoint 97-2003 binary presentations (MS-PPT, MS-ODRAW) held in a compound file. Everything is reached through the persist directory built from the user-edit chain, never by scanning the stream, so stale records from earlier edits are ignored as the specification requires. Slides are mapped onto the same shape model as PresentationML slides.
presentation
The presentation part (p:presentation, ECMA-376 Part 1, 19.2.1.26): the slide and master id lists that give the deck its order, and the slide and notes sizes.
properties
Package metadata: the Core Properties part (ECMA-376 Part 2, clause 11) and the Extended Properties part (Part 1, clause 22.2). Both are read leniently: unknown elements are skipped, values are trimmed, and an empty element counts as absent.
slide
Parser for slide-family parts (p:sld, p:sldLayout, p:sldMaster, p:notes, p:notesMaster, p:handoutMaster) into the content model.
text
Plain-text extraction from slide content, and the report that says what it left out.
xml
A pull tokenizer for the XML subset Office Open XML parts use.
zip
ZIP container reader for OPC packages (ECMA-376 Part 2, Annex B; PKWARE APPNOTE 6.3).