summaryrefslogtreecommitdiffstats
path: root/main.rb
diff options
context:
space:
mode:
authorRobert Gerus <ar@bash.org.pl>2020-03-07 17:16:32 +0100
committerRobert Gerus <ar@bash.org.pl>2020-03-07 17:44:16 +0100
commit40211a089f4dc11159de9a30cad0e72f8fa749a6 (patch)
tree21ad8f4586b3d647df6b66b697b6c314b77a4687 /main.rb
parent4cab9f4707f4615d1c5de559dec2cb125d345fcc (diff)
downloadspejstore-labelmaker-master.tar.gz
spejstore-labelmaker-master.tar.bz2
spejstore-labelmaker-master.zip
Respect label sizeHEADmaster
Diffstat (limited to 'main.rb')
-rw-r--r--main.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.rb b/main.rb
index aaa9dd3..882a4d8 100644
--- a/main.rb
+++ b/main.rb
@@ -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",