Sha256: 11ebb3dfb2ee43f74174f114d54a195837ebabe2c5721c0c9f310ebd0471607d

Contents?: true

Size: 695 Bytes

Versions: 8

Compression:

Stored size: 695 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.dirname(__FILE__)}/../example_helper.rb"

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

Prawn::Document.generate("background.pdf", :background => img) 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

8 entries across 8 versions & 2 rubygems

Version Path
prawn-core-0.7.2 examples/general/background.rb
prawn-core-0.7.1 examples/general/background.rb
prawn-layout-0.3.2 vendor/prawn-core/examples/general/background.rb
prawn-core-0.6.3 examples/general/background.rb
prawn-core-0.6.2 examples/general/background.rb
prawn-layout-0.3.1 vendor/prawn-core/examples/general/background.rb
prawn-core-0.6.1 examples/general/background.rb
prawn-core-0.5.1 examples/general/background.rb