pub struct Presentation { /* private fields */ }Expand description
Represents a PowerPoint presentation
Implementations§
Source§impl Presentation
impl Presentation
Sourcepub fn with_title(title: &str) -> Self
pub fn with_title(title: &str) -> Self
Create a presentation with a title
Sourcepub fn add_slide(self, slide: SlideContent) -> Self
pub fn add_slide(self, slide: SlideContent) -> Self
Add a slide to the presentation
Sourcepub fn add_presentation(self, other: Presentation) -> Self
pub fn add_presentation(self, other: Presentation) -> Self
Append slides from another presentation
Sourcepub fn slide_count(&self) -> usize
pub fn slide_count(&self) -> usize
Get the number of slides
Sourcepub fn slides(&self) -> &[SlideContent]
pub fn slides(&self) -> &[SlideContent]
Get the slides in the presentation
Sourcepub fn with_theme(self, theme: PresentationTheme) -> Self
pub fn with_theme(self, theme: PresentationTheme) -> Self
Apply a custom color/font theme to the generated PPTX
Sourcepub fn with_settings(self, settings: PresentationSettings) -> Self
pub fn with_settings(self, settings: PresentationSettings) -> Self
Set presentation-level settings (theme, slide show, print, etc.)
Sourcepub fn into_bytes(self) -> Result<Vec<u8>>
pub fn into_bytes(self) -> Result<Vec<u8>>
Consume the presentation and build PPTX bytes without cloning slide data.
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Create a presentation from a PPTX file
Sourcepub fn save_as_html<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save_as_html<P: AsRef<Path>>(&self, path: P) -> Result<()>
Export the presentation to HTML
Sourcepub fn save_as_pdf<P: AsRef<Path>>(&self, output_path: P) -> Result<()>
pub fn save_as_pdf<P: AsRef<Path>>(&self, output_path: P) -> Result<()>
Export the presentation to PDF using pure-Rust vector rendering.
Each slide is rendered as a native PDF page with title, bullets, and content drawn as vector text and graphics. No external binaries (LibreOffice, Poppler, etc.) are required.
Sourcepub fn save_as_pdf_via_pdfrs<P: AsRef<Path>>(
&self,
output_path: P,
options: &PdfExportOptions,
) -> Result<()>
pub fn save_as_pdf_via_pdfrs<P: AsRef<Path>>( &self, output_path: P, options: &PdfExportOptions, ) -> Result<()>
Export the presentation to PDF with custom options using the pure-Rust pdfrs engine.
Like Presentation::save_as_pdf but allows customizing orientation,
font, font size, and which Markdown sections are included.
§Arguments
output_path- Path to the PDF file to write.options-crate::export::pdf_export::PdfExportOptionscontrolling orientation, font, font size, and which Markdown sections are included.
Sourcepub fn to_pdf_bytes(&self, options: &PdfExportOptions) -> Result<Vec<u8>>
pub fn to_pdf_bytes(&self, options: &PdfExportOptions) -> Result<Vec<u8>>
Render the presentation to PDF bytes using the pure-Rust pdfrs engine.
Returns the raw PDF byte buffer instead of writing to disk. Useful for embedding in HTTP responses, mailing systems, or piping to other tools.
Requires the pdf-native Cargo feature.
Sourcepub fn save_as_png<P: AsRef<Path>>(&self, output_dir: P) -> Result<()>
pub fn save_as_png<P: AsRef<Path>>(&self, output_dir: P) -> Result<()>
Export slides to PNG images
Requires pdftoppm (from poppler) to be installed.
Images will be named slide-1.png, slide-2.png, etc. in the output directory.
Sourcepub fn from_pdf<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_pdf<P: AsRef<Path>>(path: P) -> Result<Self>
Create a presentation from a PDF file (each page becomes a slide)
Requires pdftoppm (from poppler) to be installed.
Sourcepub fn save_as_markdown_with_options<P: AsRef<Path>>(
&self,
path: P,
options: &MarkdownOptions,
) -> Result<()>
pub fn save_as_markdown_with_options<P: AsRef<Path>>( &self, path: P, options: &MarkdownOptions, ) -> Result<()>
Export the presentation to Markdown with custom options
Sourcepub fn save_as_images<P: AsRef<Path>>(
&self,
output_dir: P,
options: &ImageExportOptions,
) -> Result<Vec<PathBuf>>
pub fn save_as_images<P: AsRef<Path>>( &self, output_dir: P, options: &ImageExportOptions, ) -> Result<Vec<PathBuf>>
Sourcepub fn save_slide_as_image<P: AsRef<Path>>(
&self,
slide_number: usize,
output_path: P,
options: &ImageExportOptions,
) -> Result<PathBuf>
pub fn save_slide_as_image<P: AsRef<Path>>( &self, slide_number: usize, output_path: P, options: &ImageExportOptions, ) -> Result<PathBuf>
Export a specific slide to an image file
§Arguments
slide_number- 1-based slide numberoutput_path- Output file pathoptions- Image export options
Sourcepub fn save_thumbnail<P: AsRef<Path>>(
&self,
output_path: P,
width: u32,
) -> Result<PathBuf>
pub fn save_thumbnail<P: AsRef<Path>>( &self, output_path: P, width: u32, ) -> Result<PathBuf>
Render a thumbnail of the first slide
§Arguments
output_path- Output file pathwidth- Desired width in pixels
Sourcepub fn compress<P: AsRef<Path>>(
&self,
output_path: P,
options: &CompressionOptions,
) -> Result<CompressionResult>
pub fn compress<P: AsRef<Path>>( &self, output_path: P, options: &CompressionOptions, ) -> Result<CompressionResult>
Sourcepub fn analyze_size(&self) -> Result<PptxAnalysis>
pub fn analyze_size(&self) -> Result<PptxAnalysis>
Get file size analysis
Returns analysis of what contributes to file size.
Trait Implementations§
Source§impl Clone for Presentation
impl Clone for Presentation
Source§fn clone(&self) -> Presentation
fn clone(&self) -> Presentation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Presentation
impl Debug for Presentation
Source§impl Default for Presentation
impl Default for Presentation
Source§fn default() -> Presentation
fn default() -> Presentation
Auto Trait Implementations§
impl Freeze for Presentation
impl RefUnwindSafe for Presentation
impl Send for Presentation
impl Sync for Presentation
impl Unpin for Presentation
impl UnsafeUnpin for Presentation
impl UnwindSafe for Presentation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.