Sha256: f32456eec71f3166c1ed18722a36ecd28e1963f10e95bf2279f0178e14134d74

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

# encoding: utf-8
#
# Demonstrates basic image embedding and positioning functionality.
# For positioning images alongside flowing text, see the image_flow.rb
# example.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))
   
Prawn::Document.generate("basic_images.pdf", :page_layout => :landscape) do     
  stef = "#{Prawn::BASEDIR}/data/images/stef.jpg"
  image stef, :at => [75, 75] 
  
  stef = "#{Prawn::BASEDIR}/data/images/stef.jpg"
  image stef, :at => [500, 400], :width => 200, :height => 200 
  
  draw_text "Please enjoy the pigs", :size => 36, :at => [200,15]   
  
  ruport = "#{Prawn::BASEDIR}/data/images/ruport.png"  
  image ruport, :at => [400,200], :width => 150 

  ruport = "#{Prawn::BASEDIR}/data/images/ruport_transparent.png"  
  image ruport, :at => [50,525] 
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
prawn-0.11.1 examples/graphics/basic_images.rb
davebenvenuti-prawn-0.11.1.pre examples/graphics/basic_images.rb