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 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 LibreOffice
Requires LibreOffice to be installed and available via soffice command.
On macOS, it also checks /Applications/LibreOffice.app/Contents/MacOS/soffice.
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 LibreOffice (for PDF conversion) and pdftoppm (from poppler).
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 more