Sha256: 2c5790ac2796ca756f2316536075337069355c18ebe9c8bbc5db78b5c6525acf

Contents?: true

Size: 820 Bytes

Versions: 20

Compression:

Stored size: 820 Bytes

Contents

# encoding: utf-8
#
# This demonstrates that Prawn can modify page size, margins and layout for 
# each individual page, via Document#start_new_page()
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate("multi-layout.pdf", :page_layout => :landscape) do |pdf|
   pdf.text "This is on a landscaped page" 
   pdf.start_new_page(:layout => :portrait)
   pdf.text "This is on a portrait page"   
   pdf.start_new_page(:size => "LEGAL")
   pdf.text "This is on legal paper size"      
   pdf.start_new_page(:left_margin => 150, :right_margin => 150)
   pdf.text "This page has very wide left and right margins, causing a squeeze"
   pdf.start_new_page(:margin => 300, :right_margin => 0)
   pdf.text "This page has even wider margins on all sides except for the right side, where it's 0"
end

Version data entries

20 entries across 20 versions & 7 rubygems

Version Path
piglop-prawn-0.10.2.3 examples/general/multi_page_layout.rb
piglop-prawn-0.10.2.2 examples/general/multi_page_layout.rb
piglop-prawn-0.10.2.1 examples/general/multi_page_layout.rb
prawn-0.11.1.pre examples/general/multi_page_layout.rb
goodwill-prawn-edge-0.10.0 examples/general/multi_page_layout.rb
alphasights-prawn-0.10.4 examples/general/multi_page_layout.rb
alphasights-prawn-0.10.3 examples/general/multi_page_layout.rb
alphasights-prawn-0.10.2 examples/general/multi_page_layout.rb
alphasights-prawn-0.10.1 examples/general/multi_page_layout.rb
alphasights-prawn-0.10.0 examples/general/multi_page_layout.rb
prawn-core-0.8.4 examples/general/multi_page_layout.rb
prawn-graph-0.0.2 vendor/prawn-core/examples/general/multi_page_layout.rb
prawn-graph-0.0.1 vendor/prawn-core/examples/general/multi_page_layout.rb
prawn-core-0.7.2 examples/general/multi_page_layout.rb
prawn-core-0.7.1 examples/general/multi_page_layout.rb
prawn-layout-0.3.2 vendor/prawn-core/examples/general/multi_page_layout.rb
prawn-core-0.6.3 examples/general/multi_page_layout.rb
prawn-core-0.6.2 examples/general/multi_page_layout.rb
prawn-layout-0.3.1 vendor/prawn-core/examples/general/multi_page_layout.rb
prawn-core-0.6.1 examples/general/multi_page_layout.rb