Sha256: 93415b07c3ad8bbb2fec6490a5b6c84edb214f234fef94bec662d02470c7b35c

Contents?: true

Size: 613 Bytes

Versions: 21

Compression:

Stored size: 613 Bytes

Contents

# encoding: utf-8
#
# Demonstrates Document#stroke_bounds, which will stroke a rectange outlining
# the boundaries of the current bounding box.  This is useful for debugging
# and can also be used as a light-weight and lower level alternative to
# Cells.  
#
# Feature borrowed from Josh Knowle's pt at:
# http://github.com/joshknowles/pt/tree/master
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate("stroke_bounds.pdf") do 
  stroke_bounds
  
  bounding_box [100,500], :width => 200, :height => 300 do
    text "Hey there, here's some text. " * 10
    stroke_bounds
  end
end

Version data entries

21 entries across 21 versions & 7 rubygems

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