Sha256: 66e720b6a9b9b176e0d2d809891d5814e7df3b24b6d92c2e97bdd10b4eb7ddbf

Contents?: true

Size: 462 Bytes

Versions: 21

Compression:

Stored size: 462 Bytes

Contents

# encoding: utf-8
#
# Demonstrates fitting an image within a rectangular width and height.
# The image will be scaled down to fit within the box, while preserving
# the aspect ratio.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"
   
Prawn::Document.generate("image_fit.pdf", :page_layout => :landscape) do

  pigs = "#{Prawn::BASEDIR}/data/images/pigs.jpg" 
  stroke_rectangle [50,450], 200, 200
  image pigs, :at => [50,450], :fit => [200,200]

end

Version data entries

21 entries across 21 versions & 7 rubygems

Version Path
prawn-core-0.5.1 examples/graphics/image_fit.rb