Respect label size
This commit is contained in:
parent
4cab9f4707
commit
40211a089f
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
3
main.rb
3
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",
|
||||
|
|
Loading…
Reference in a new issue