Sha256: e2594488de16cf081a79ecb9e629fa978583d477b91206fb270a7171886d9c3c

Contents?: true

Size: 1.09 KB

Versions: 8

Compression:

Stored size: 1.09 KB

Contents

# encoding: utf-8
#
# To set the vertical position of an image use the <code>:vposition</code>
# option.
#
# It may be <code>:top</code>, <code>:center</code>, <code>:bottom</code> or a
# number representing the y-offset from the top boundary.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::Example.generate(filename) do
  bounding_box([0, cursor], :width => 500, :height => 450) do
    stroke_bounds
    
    [:top, :center, :bottom].each do |vposition|
      text "Image vertically aligned to the #{vposition}.", :valign => vposition
      image "#{Prawn::DATADIR}/images/stef.jpg", :position  => 250,
                                                 :vposition => vposition
    end
    
    text_box "The next image has a 100 point offset from the top boundary",
             :at => [bounds.width - 110, bounds.top - 10], :width => 100
    image "#{Prawn::DATADIR}/images/stef.jpg", :position  => :right,
                                               :vposition => 100
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

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