Sha256: c4c6f7517ef5e23483a959af56b8e3a916c19953fabd8c8d52a496658ac27200

Contents?: true

Size: 772 Bytes

Versions: 2

Compression:

Stored size: 772 Bytes

Contents

# encoding: utf-8
#
# This example demonstrates the use of the new :background option when
# generating a new Document.  Image is assumed to be pre-fit for your page
# size, and will not be rescaled.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

img = "#{Prawn::BASEDIR}/data/images/letterhead.jpg"

Prawn::Document.generate("background.pdf", :background => img, :margin => 100) do
  text "My report caption", :size => 18, :align => :right

  move_down font.height * 2

  text "Here is my text explaning this report. " * 20, 
    :size => 12, :align => :left, :leading => 2

  move_down font.height

  text "I'm using a soft background. " * 40,
    :size => 12, :align => :left, :leading => 2
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
prawn-0.11.1 examples/general/background.rb
davebenvenuti-prawn-0.11.1.pre examples/general/background.rb