diff options
author | Robert Gerus <ar@bash.org.pl> | 2020-03-07 17:16:32 +0100 |
---|---|---|
committer | Robert Gerus <ar@bash.org.pl> | 2020-03-07 17:44:16 +0100 |
commit | 40211a089f4dc11159de9a30cad0e72f8fa749a6 (patch) | |
tree | 21ad8f4586b3d647df6b66b697b6c314b77a4687 | |
parent | 4cab9f4707f4615d1c5de559dec2cb125d345fcc (diff) | |
download | spejstore-labelmaker-40211a089f4dc11159de9a30cad0e72f8fa749a6.tar.gz spejstore-labelmaker-40211a089f4dc11159de9a30cad0e72f8fa749a6.tar.bz2 spejstore-labelmaker-40211a089f4dc11159de9a30cad0e72f8fa749a6.tar.xz spejstore-labelmaker-40211a089f4dc11159de9a30cad0e72f8fa749a6.zip |
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | main.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index f7f0c59..c1f3d62 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,7 @@ GEM css_parser (1.4.9) addressable excon (0.55.0) - json (1.8.3) + json (1.8.6) pdf-core (0.6.1) prawn (2.1.0) pdf-core (~> 0.6.1) @@ -70,8 +70,9 @@ end def render_label(label) label = api("labels/#{label}") + length, width = label["style"].values_at("length", "width") - pdf = Prawn::Document.new(page_size: [89, 36].map { |x| mm2pt(x) }, + pdf = Prawn::Document.new(page_size: [length, width].map { |x| mm2pt(x) }, margin: [2, 2, 2, 6].map { |x| mm2pt(x) }) do font_families.update("DejaVuSans" => { normal: "fonts/DejaVuSans.ttf", |