Sha256: ebdb8ba7e532e9a021f4c66e29c809d432f11b981bbef919bab6bf05a15120be

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

# To scale an image use the <code>:scale</code> option.
#
# It scales the image proportionally given the provided value.

require_relative '../example_helper'

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  text  'Normal size'
  image "#{Prawn::DATADIR}/images/stef.jpg"
  move_down 20

  text  'Scaled to 50%'
  image "#{Prawn::DATADIR}/images/stef.jpg", scale: 0.5
  move_down 20

  text  'Scaled to 200%'
  image "#{Prawn::DATADIR}/images/stef.jpg", scale: 2
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
prawn-2.2.2 manual/images/scale.rb
prawn-2.2.1 manual/images/scale.rb
prawn-2.2.0 manual/images/scale.rb