diff options
Diffstat (limited to 'src/pdfgen.rs')
-rw-r--r-- | src/pdfgen.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pdfgen.rs b/src/pdfgen.rs index b8c7f7d..410bb99 100644 --- a/src/pdfgen.rs +++ b/src/pdfgen.rs @@ -1,8 +1,7 @@ use genpdf::Element as _; use genpdf::{elements, style, fonts}; -use crate::model::BCard; -pub fn genpdf(bcard: BCard) -> Vec<u8> { +pub fn genpdf() -> Vec<u8> { let regular_bytes = include_bytes!("../fonts/fira-sans.regular.ttf"); let regular_font_data = fonts::FontData::new(regular_bytes.to_vec(), None).expect("font data should be correct"); @@ -43,6 +42,6 @@ pub fn genpdf(bcard: BCard) -> Vec<u8> { // TODO fill doc with real data let mut buf: Vec<u8> = Vec::new(); - doc.render(&mut buf); + doc.render(&mut buf).expect("should render pdf"); buf }
\ No newline at end of file |