Skip to content

Instantly share code, notes, and snippets.

@zhhz
Created January 25, 2009 23:28
Show Gist options
  • Save zhhz/52613 to your computer and use it in GitHub Desktop.
Save zhhz/52613 to your computer and use it in GitHub Desktop.
# price_letter.pdf.erb
<%=
require "prawn/measurement_extensions"
require "prawn/table"
pdf = Prawn::Document.new(
:page_size => "A4",
:left_margin => 2.cm,
:right_margin => 2.cm,
:top_margin => 2.cm,
:bottom_margin => 1.5.cm
)
# logo
logo = image_dir + 'logo.jpg'
pdf.image logo, :position => :center
pdf.font "Times-Roman"
...
pdf.render
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment