use pdfmake_rust::{Document, DocumentNode, Margins, PageSize, PdfMake, TextNode};
use std::fs;

fn main() {
    let doc = Document::builder()
        .page_size(PageSize::a4())
        .page_margins(Margins::all(40.0))
        .content(DocumentNode::Text(TextNode::new("Hello, World!")))
        .build();

    let pdf = PdfMake::new();
    let bytes = pdf.render(&doc).expect("Failed to render PDF");

    fs::write("examples/pdfs/hello_world.pdf", &bytes).expect("Failed to write PDF");
    println!("Generated examples/pdfs/hello_world.pdf ({} bytes)", bytes.len());
}
