Skip to main content

test_notes/
test_notes.rs

1//! Test notes functionality with proper GUID
2
3use ppt_rs::generator::{create_pptx_with_content, SlideContent, SlideLayout};
4use std::fs;
5
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    println!("Creating test presentation with speaker notes...");
8    
9    let slides = vec![
10        SlideContent::new("Slide 1 - With Notes")
11            .layout(SlideLayout::CenteredTitle)
12            .title_size(54)
13            .title_bold(true)
14            .notes("This is a speaker note for slide 1. It should appear in presenter view."),
15        
16        SlideContent::new("Slide 2 - Also With Notes")
17            .add_bullet("Bullet point 1")
18            .add_bullet("Bullet point 2")
19            .add_bullet("Bullet point 3")
20            .notes("Notes for slide 2 with bullet points."),
21        
22        SlideContent::new("Slide 3 - No Notes")
23            .add_bullet("This slide has no notes"),
24        
25        SlideContent::new("Slide 4 - More Notes")
26            .layout(SlideLayout::TwoColumn)
27            .add_bullet("Left 1")
28            .add_bullet("Left 2")
29            .add_bullet("Right 1")
30            .add_bullet("Right 2")
31            .notes("Two column layout with speaker notes."),
32    ];
33    
34    let pptx_data = create_pptx_with_content("Test Notes", slides)?;
35    fs::write("test_notes.pptx", &pptx_data)?;
36    println!("Created test_notes.pptx ({} bytes)", pptx_data.len());
37    println!("\nOpen in PowerPoint and check presenter view for notes!");
38    
39    Ok(())
40}