Sha256: aeeb90af3e5b103027b4e56213d31cf34f15c9c799b9c589b64b1093ef84fec9

Contents?: true

Size: 1009 Bytes

Versions: 21

Compression:

Stored size: 1009 Bytes

Contents

# encoding: utf-8
#
# This example demonstrates the basic functionality of Prawn's bounding boxes.
# Note that top level bounding boxes are positioned relative to the margin_box.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate("indentation.pdf") do

  text "No indentation"
  indent(20) do
    text "Some indentation"
    # Generates a box with a top-left of [100,600] and a top-right of [300,600]
    # The box automatically expands as the cursor moves down the page.  Notice
    # that the final coordinates are outlined by a top and bottom line drawn
    # relatively using calculations from +bounds+.
    #
    bounding_box [100,600], :width => 200 do
      text "A little more indentation"
      indent(20) do
        text "And some more indentation"
        indent(20) do
          text "And some deeper indentation"
        end
      end
    end
    text "Some indentation"
  end
  indent(10) do
    text "A bit of indentation"
  end
  
  text "No indentation"
end

Version data entries

21 entries across 21 versions & 7 rubygems

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