Sha256: 907956c116f1a3abfba691420537cb782e30ff24ff482134fce83da4d14c847e

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 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.
#
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
require "prawn"
   
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

4 entries across 4 versions & 2 rubygems

Version Path
kavu-prawn-core-0.4.100 examples/graphics/image_flow.rb
kavu-prawn-core-0.4.99 examples/graphics/image_flow.rb
prawn-0.4.0 examples/graphics/image_flow.rb
prawn-0.4.1 examples/graphics/image_flow.rb