Sha256: 9752be31d4a4fd6d3366f62eaa30d7cab3f690c7973cc54ab455ce477e9fa1c6

Contents?: true

Size: 995 Bytes

Versions: 6

Compression:

Stored size: 995 Bytes

Contents

# encoding: utf-8
#
# Examples for embedding images.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

Prawn::ManualBuilder::Example.generate("images.pdf", :page_size => "FOLIO") do

  package "images" do |p|

    p.section "Basics" do |s|
      s.example "plain_image"
      s.example "absolute_position"
    end

    p.section "Relative Positioning" do |s|
      s.example "horizontal"
      s.example "vertical"
    end

    p.section "Size" do |s|
      s.example "width_and_height"
      s.example "scale"
      s.example "fit"
    end

    p.intro do
      prose("Embedding images on PDF documents is fairly easy. Prawn supports both JPG and PNG images.

      The examples show:")

      list( "How to add an image to a page",
            "How place the image on a specific position",
            "How to configure the image dimensions by setting the width and height or by scaling it"
          )
    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
prawn-git-2.0.1 manual/images/images.rb
prawn-2.0.1 manual/images/images.rb
prawn-2.0.0 manual/images/images.rb
prawn-1.3.0 manual/images/images.rb
prawn-1.2.1 manual/images/images.rb
prawn-1.1.0 manual/images/images.rb