Created
October 12, 2016 14:03
-
-
Save f3lan/189ed3c863a2ef7bb8ebaf396ea76505 to your computer and use it in GitHub Desktop.
Creating 6 boxes with numbers in ruby prawn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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