Sha256: fdbd452b7c9b29372b601aa9181ffcade6996afce1edf9518d32559d85e910e5

Contents?: true

Size: 754 Bytes

Versions: 21

Compression:

Stored size: 754 Bytes

Contents

# encoding: utf-8
#
# PNG files come in different flavours - 5 of them. This example embeds
# one of each type as proof that they all work.
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

images = [
          ["Type 0", "#{Prawn::BASEDIR}/data/images/web-links.png"],
          ["Type 2", "#{Prawn::BASEDIR}/data/images/ruport.png"],
          ["Type 3", "#{Prawn::BASEDIR}/data/images/rails.png"],
          ["Type 4", "#{Prawn::BASEDIR}/data/images/page_white_text.png"],
          ["Type 6", "#{Prawn::BASEDIR}/data/images/dice.png"],
]

Prawn::Document.generate("png_types.pdf", :page_size => "A5") do
  images.each do |header, file|
    start_new_page unless header.include?("0")
    text header
    image file, :at => [50,450]
  end
end

Version data entries

21 entries across 21 versions & 7 rubygems

Version Path
piglop-prawn-0.10.2.3 examples/graphics/png_types.rb
piglop-prawn-0.10.2.2 examples/graphics/png_types.rb
piglop-prawn-0.10.2.1 examples/graphics/png_types.rb
prawn-0.11.1.pre examples/graphics/png_types.rb
goodwill-prawn-edge-0.10.0 examples/graphics/png_types.rb
alphasights-prawn-0.10.4 examples/graphics/png_types.rb
alphasights-prawn-0.10.3 examples/graphics/png_types.rb
alphasights-prawn-0.10.2 examples/graphics/png_types.rb
alphasights-prawn-0.10.1 examples/graphics/png_types.rb
alphasights-prawn-0.10.0 examples/graphics/png_types.rb
prawn-core-0.8.4 examples/graphics/png_types.rb
prawn-graph-0.0.2 vendor/prawn-core/examples/graphics/png_types.rb
prawn-graph-0.0.1 vendor/prawn-core/examples/graphics/png_types.rb
prawn-core-0.7.2 examples/graphics/png_types.rb
prawn-core-0.7.1 examples/graphics/png_types.rb
prawn-layout-0.3.2 vendor/prawn-core/examples/graphics/png_types.rb
prawn-core-0.6.3 examples/graphics/png_types.rb
prawn-core-0.6.2 examples/graphics/png_types.rb
prawn-layout-0.3.1 vendor/prawn-core/examples/graphics/png_types.rb
prawn-core-0.6.1 examples/graphics/png_types.rb