diff options
author | jelemux <jeremias.weber@protonmail.com> | 2020-10-19 22:46:45 +0200 |
---|---|---|
committer | jelemux <jeremias.weber@protonmail.com> | 2020-10-19 22:46:45 +0200 |
commit | 3a0a55362fd98c74bfb14df320bcacafd0c57835 (patch) | |
tree | ad7f91af95df638bfbc58c48c97f34340ae37a8c /src/pdfgen.rs | |
parent | 84c2dab4200c37c818d83c95f85445ee00d83bf6 (diff) | |
download | wasm-card-3a0a55362fd98c74bfb14df320bcacafd0c57835.tar.gz wasm-card-3a0a55362fd98c74bfb14df320bcacafd0c57835.tar.bz2 |
break things down into their most basic parts
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 |