Sha256: d9b628ab0df550e676342691f983a1a9ef139b449ae7fd674d34e2866dce906a

Contents?: true

Size: 711 Bytes

Versions: 13

Compression:

Stored size: 711 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, :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

13 entries across 13 versions & 6 rubygems

Version Path
piglop-prawn-0.10.2.3 examples/general/background.rb
piglop-prawn-0.10.2.2 examples/general/background.rb
piglop-prawn-0.10.2.1 examples/general/background.rb
prawn-0.11.1.pre examples/general/background.rb
goodwill-prawn-edge-0.10.0 examples/general/background.rb
alphasights-prawn-0.10.4 examples/general/background.rb
alphasights-prawn-0.10.3 examples/general/background.rb
alphasights-prawn-0.10.2 examples/general/background.rb
alphasights-prawn-0.10.1 examples/general/background.rb
alphasights-prawn-0.10.0 examples/general/background.rb
prawn-core-0.8.4 examples/general/background.rb
prawn-graph-0.0.2 vendor/prawn-core/examples/general/background.rb
prawn-graph-0.0.1 vendor/prawn-core/examples/general/background.rb