Sha256: a85b17d6ee1d654d98071a1e3017f3229dc22bd4af6604d4876985761e706736

Contents?: true

Size: 813 Bytes

Versions: 8

Compression:

Stored size: 813 Bytes

Contents

# encoding: utf-8
#
# Pass an image path to the <code>:background</code> option and it will be used
# as the background for all pages.
# This option can only be used on document creation. 
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

img = "#{Prawn::DATADIR}/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

8 entries across 8 versions & 2 rubygems

Version Path
prawn-1.0.0 manual/document_and_page_options/background.rb
prawn-0.15.0 manual/document_and_page_options/background.rb
prawn-0.14.0 manual/document_and_page_options/background.rb
prawn-0.13.2 manual/document_and_page_options/background.rb
prawn-0.13.1 manual/document_and_page_options/background.rb
prawn-0.13.0 manual/document_and_page_options/background.rb
prawn-1.0.0.rc2 manual/document_and_page_options/background.rb
nurettin-prawn-1.0.0.rc1 manual/document_and_page_options/background.rb