Skip to content

Instantly share code, notes, and snippets.

@f3lan
Created October 12, 2016 14:03
Show Gist options
  • Save f3lan/189ed3c863a2ef7bb8ebaf396ea76505 to your computer and use it in GitHub Desktop.
Save f3lan/189ed3c863a2ef7bb8ebaf396ea76505 to your computer and use it in GitHub Desktop.
Creating 6 boxes with numbers in ruby prawn
require "prawn"
Prawn::Document.generate("boxes.pdf") do
y = 20
x = 700
a = 15
gap = 5
6.times do |number|
stroke_rectangle [y, x], a, a
draw_text "#{number}", :size => 10, :at => [y + gap,x - (2*gap)]
y += gap + a
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment