Skip to main content

ppt_rs/
lib.rs

1//! PowerPoint (.pptx) file manipulation library
2//!
3//! A comprehensive Rust library for creating, reading, and updating PowerPoint 2007+ (.pptx) files.
4//!
5//! # Quick Start
6//!
7//! ```rust,no_run
8//! use ppt_rs::{create_pptx_with_content, SlideContent};
9//!
10//! let slides = vec![
11//!     SlideContent::new("Welcome")
12//!         .add_bullet("First point")
13//!         .add_bullet("Second point"),
14//! ];
15//! let pptx_data = create_pptx_with_content("My Presentation", slides).unwrap();
16//! std::fs::write("output.pptx", pptx_data).unwrap();
17//! ```
18//!
19//! # Module Organization
20//!
21//! - **core** - Core traits (`ToXml`, `Positioned`) and utilities
22//! - **elements** - Unified element types (Color, Position, Size, Transform)
23//! - **generator** - PPTX file generation with ZIP packaging and XML creation
24//! - **parts** - Package parts (SlidePart, ImagePart, ChartPart)
25//! - **integration** - High-level builders for presentations
26//! - **opc** - Open Packaging Convention (ZIP) handling
27//! - **oxml** - Office XML parsing and manipulation
28//! - **exc** - Error types
29
30pub mod core;
31pub mod elements;
32pub mod generator;
33pub mod cli;
34pub mod exc;
35pub mod opc;
36pub mod oxml;
37pub mod parts;
38pub mod api;
39pub mod prelude;
40pub mod helpers;
41pub mod templates;
42pub mod export;
43pub mod import;
44
45#[cfg(feature = "web2ppt")]
46pub mod web2ppt;
47
48pub use api::Presentation;
49pub use core::{ToXml, escape_xml};
50pub use elements::{Color, RgbColor, SchemeColor, Position, Size, Transform};
51pub use exc::{PptxError, Result};
52pub use generator::{
53    create_pptx, create_pptx_with_content, create_pptx_with_settings,
54    create_pptx_to_writer, create_pptx_with_content_to_writer, create_pptx_lazy_to_writer,
55    LazySlideSource,
56    SlideContent, SlideLayout,
57    TextFormat, FormattedText,
58    Table, TableRow, TableCell, TableBuilder,
59    Shape, ShapeType, ShapeFill, ShapeLine,
60    Image, ImageBuilder, ImageSource,
61    Chart, ChartType, ChartSeries, ChartBuilder,
62    BulletStyle, BulletPoint,
63    TextDirection, RtlLanguage, RtlTextProps,
64    Comment, CommentAuthor, CommentAuthorList, SlideComments,
65    SlideSection, SectionManager,
66    DigitalSignature, SignerInfo, HashAlgorithm, SignatureCommitment,
67    InkAnnotations, InkStroke, InkPen, InkPoint, PenTip,
68    SlideShowSettings, ShowType, PenColor, SlideRange,
69    PrintSettings, HandoutLayout, PrintColorMode, PrintWhat, Orientation,
70    TableMergeMap, MergeRegion, CellMergeState,
71    EmbeddedFontList, EmbeddedFont, FontStyle, FontCharset,
72    PresentationSettings,
73    Connector, ConnectorType, ConnectorLine, ArrowType, ArrowSize, ConnectionSite, LineDash,
74    Hyperlink, HyperlinkAction,
75    GradientFill, GradientType, GradientDirection, GradientStop, PresetGradients,
76    Video, Audio, VideoFormat, AudioFormat, VideoOptions, AudioOptions,
77};
78pub use oxml::repair::{PptxRepair, RepairIssue, RepairResult};
79
80pub use parts::{
81    Part, PartType, ContentType,
82    PresentationPart, SlidePart, SlideLayoutPart, LayoutType,
83    SlideMasterPart, ThemePart, NotesSlidePart,
84    ImagePart, MediaPart, MediaFormat, ChartPart,
85    TablePart, TableRowPart, TableCellPart,
86    CorePropertiesPart, AppPropertiesPart,
87    ContentTypesPart, Relationships,
88};
89
90#[cfg(feature = "web2ppt")]
91pub use web2ppt::{
92    Web2Ppt, WebFetcher, WebParser, WebContent, ContentBlock,
93    ContentType as WebContentType,
94    Web2PptConfig, ConversionOptions, Web2PptError,
95    html_to_pptx, html_to_pptx_with_options, url_to_pptx, url_to_pptx_with_options,
96};
97
98pub const VERSION: &str = "0.2.7";