use lo_core::{units::Length, write_text_pdf, TextDocument};
pub fn to_pdf(document: &TextDocument) -> Vec<u8> {
to_pdf_with_size(document, Length::pt(595.0), Length::pt(842.0))
}
pub fn to_pdf_with_size(document: &TextDocument, width: Length, height: Length) -> Vec<u8> {
let lines: Vec<String> = document
.plain_text()
.lines()
.map(|s| s.to_string())
.collect();
write_text_pdf(&lines, width, height)
}