//! Render a representative article to a PDF for visual inspection. //! Usage: cargo run -p bb-pdf --example sample -- /path/to/out.pdf fn main() { let out = std::env::args() .nth(1) .unwrap_or_else(|| "bb-pdf-sample.pdf".to_string()); let html = r#"
This is a bold lead paragraph with an italic aside, long enough to force line wrapping across the A5 column so we can see how the body text flows on the Supernote page.
Ordinary body copy follows, then a list:
A quoted passage, rendered in italic with a left indent.
fn main() { println!("monospace"); }
And a closing paragraph to round things out. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.
"#; let bytes = bb_pdf::render_article( html, "Sample Article", Some("https://example.com/morning-read"), ) .expect("render"); std::fs::write(&out, &bytes).expect("write"); println!("wrote {} ({} bytes)", out, bytes.len()); }