Skip to content
Browse files

Using document background sample. Ticket #130

  • Loading branch information...
1 parent e507f21 commit 28e4b4c3b32a3b192688f16b923ed6d0df40f4a7 @riopro riopro committed Nov 26, 2008
Showing with 14 additions and 0 deletions.
  1. BIN data/images/letterhead.jpg
  2. +14 −0 examples/background.rb
View
BIN data/images/letterhead.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
14 examples/background.rb
@@ -0,0 +1,14 @@
+# encoding: utf-8
+
+$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
+require "prawn"
+
+Prawn::Document.generate("background.pdf", :background => "#{Prawn::BASEDIR}/data/images/letterhead.jpg") do
+ text_options.update(:size => 18, :align => :right)
+ text "My report caption"
+ text_options.update(:size => 12, :align => :left, :spacing => 2)
+ move_down font.height * 2
+ text "Here is my text explaning this report. " * 20
+ move_down font.height
+ text "I'm using a soft background. " * 40
+end

0 comments on commit 28e4b4c

Please sign in to comment.
Something went wrong with that request. Please try again.