Skip to content

Instantly share code, notes, and snippets.

@wilsoncolab
Created April 15, 2009 17:03
Show Gist options
  • Save wilsoncolab/95902 to your computer and use it in GitHub Desktop.
Save wilsoncolab/95902 to your computer and use it in GitHub Desktop.
#Gallery
pdf = Prawn::Document.new(:page_size => [ 459, 595 ])
pdf.font_families.update(
"Gill" => { :bold => "#{Prawn::BASEDIR}/data/fonts/GillSansBold.ttf",
:italic => "#{Prawn::BASEDIR}/data/fonts/GillSansItalic.ttf",
:bold_italic => "#{Prawn::BASEDIR}/data/fonts/GillSansBoldItalic.ttf",
:light => "#{Prawn::BASEDIR}/data/fonts/GillSansLight.ttf",
:light_italic => "#{Prawn::BASEDIR}/data/fonts/GillSansLightItalic.ttf",
:normal => "#{Prawn::BASEDIR}/data/fonts/GillSans.ttf" })
#Name/Location
#TextBox
pdf.bounding_box [9, 490], :width => 378 do
#Character
pdf.font("Gill", :style => :bold_italic)
pdf.font_size(30)
#Name
pdf.text "Gallery Name", :align => :left
#Character
pdf.font("Gill", :style => :light)
pdf.font_size(12)
#Location
#address1
pdf.pad_top(30) do
pdf.text "123 Address 1", :align => :left
end
#address2
pdf.text "123 Address 2", :align => :left
#city
pdf.text "City", :align => :left
#state
pdf.text "State", :align => :left
#zip
pdf.text "Zip Code 1" + "Zip Code 2", :align => :left
#country
pdf.text "Country", :align => :left
#phone
pdf.text "555.555.555", :align => :left
#fax
pdf.text "555.555.555", :align => :left
#email
pdf.text "[email protected]", :align => :left
#homepage
pdf.text "http://someurl.com", :align => :left
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment