Sha256: b72f3e9bee66f9c2888e00c8f79cb573335944bad58a1b49cbea388c13104a92

Contents?: true

Size: 853 Bytes

Versions: 8

Compression:

Stored size: 853 Bytes

Contents

# encoding: utf-8
#
# If you've read the basic concepts examples you probably know that the origin
# of a page is on the bottom left corner and that the content flows from top to
# bottom.
#
# You also know that a Bounding Box is a structure for helping the content flow.
#
# A bounding box can be created with the <code>bounding_box</code> method. Just
# provide the top left corner, a required <code>:width</code> option and an
# optional <code>:height</code>.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  bounding_box([200, cursor - 100], :width => 200, :height => 100) do
    text "Just your regular bounding box"

    transparent(0.5) { stroke_bounds }
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
prawn-2.1.0 manual/bounding_box/creation.rb
prawn-git-2.0.1 manual/bounding_box/creation.rb
prawn-2.0.2 manual/bounding_box/creation.rb
prawn-2.0.1 manual/bounding_box/creation.rb
prawn-2.0.0 manual/bounding_box/creation.rb
prawn-1.3.0 manual/bounding_box/creation.rb
prawn-1.2.1 manual/bounding_box/creation.rb
prawn-1.1.0 manual/bounding_box/creation.rb