public
Created — forked from bradediger/checkbox_test.pdf

  • Download Gist
checkbox_test.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13
require 'prawn'
 
CHECKBOX = "\xE2\x98\x90" # "☐"
FILLED_CHECKBOX = "\xE2\x98\x91" # "☑"
 
Prawn::Document.generate("checkbox_test.pdf") do
# Use a font with the checkbox characters:
# http://www.fileformat.info/info/unicode/char/2610/fontsupport.htm
font "fonts/dejavu/ttf/DejaVuSans.ttf"
text "#{CHECKBOX} Not done yet"
text "#{FILLED_CHECKBOX} Complete!"
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.