Skip to content

Instantly share code, notes, and snippets.

@wilsoncolab
Created April 15, 2009 17:04
Show Gist options
  • Save wilsoncolab/95903 to your computer and use it in GitHub Desktop.
Save wilsoncolab/95903 to your computer and use it in GitHub Desktop.
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
# Text Box
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
# Street_address_line_one
pdf.pad_top(30) do
pdf.text "123 Address 1", :align => :left
end
# Street_address_line_two
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