Sha256: 24afb9c4a820b679ba9f4e6978921f6313142ff22c56824eedb9a6ee3edc6e95

Contents?: true

Size: 1 KB

Versions: 21

Compression:

Stored size: 1 KB

Contents

# encoding: utf-8
#
# Demonstrates automated flowing and positioning of images, as well as
# aligining images along the x-axis via the :position argument.  This is
# useful when used in combination with flowing text, where the exact final
# position of the image is not known ahead of time.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"
   
Prawn::Document.generate("image-flow.pdf", :page_layout => :landscape) do  
  self.font_size = 8                           
  stef = "#{Prawn::BASEDIR}/data/images/stef.jpg"  
  
  text "Image at default position with no arguments"
  
  move_down 10
  
  image stef 
  
  text "Centered image flowing" 
  
  image stef, :position => :center   
  
  text "Right aligned image flowing"
                 
  image stef, :position => :right  
  
  text "Explicitly left aligned image flowing"
                 
  move_down 10                 
                 
  image stef, :position => :left     
  
  text "Flowing image at x=50"     
  
  image stef, :position => 50
end

Version data entries

21 entries across 21 versions & 7 rubygems

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