Created
March 16, 2016 10:34
-
-
Save kinsomicrote/01907a8190b1bf1c4062 to your computer and use it in GitHub Desktop.
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("greeting-card2.pdf") do | |
font_families.update( | |
"Candara" => { | |
:normal => "#{Prawn::DATADIR}/fonts/Candara.ttf" | |
} | |
) | |
stroke_axis | |
stroke do | |
horizontal_line 0, 550 | |
end | |
stroke do | |
horizontal_line 0, 550, :at => 0 | |
end | |
stroke do | |
horizontal_line 0, 550, :at => 360 | |
end | |
stroke do | |
vertical_line 0, 720, :at => 0 | |
end | |
stroke do | |
vertical_line 0, 720, :at => 275 | |
end | |
stroke do | |
vertical_line 0, 720, :at => 550 | |
end | |
bounding_box([20, 650], :width => 250) do | |
font("Candara", :size => 40) do | |
text "MERRY", :mode => :stroke | |
text "CHRISTMAS" | |
end | |
end | |
bounding_box([300, 550], :width => 250) do | |
font("Times-Roman", :size => 20, :styles => [:bold]) do | |
text "Dear friends and family, | |
We've had a great year thanks to your love and support. | |
Wising you all the best in the coming year.", | |
:color => "0000FF" | |
end | |
end | |
rotate(180, :origin => [150, 200]) do | |
bounding_box([50, 250], :width => 250) do | |
font("Times-Roman", :size => 20, :styles => [:bold]) do | |
text "Dear friends and family, do | |
We've had a great year thanks to your love and support. | |
Wising you all the best in the coming year.", | |
:color => "0000FF" | |
end | |
end | |
end | |
rotate(180, :origin => [400, 200]) do | |
bounding_box([250, 250], :width => 250) do | |
font("Candara", :size => 40) do | |
text "MERRY", :mode => :stroke | |
text "CHRISTMAS" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment