Sha256: 37d23d699177ba182149cbe1109ed43869b2de42e102057b1303bad1c8347050

Contents?: true

Size: 816 Bytes

Versions: 3

Compression:

Stored size: 816 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.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

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

3 entries across 3 versions & 2 rubygems

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