Sha256: 7aedf62e98ca4f591b6f78e4417fb9f6652453985ed391bceb787764072c71e2

Contents?: true

Size: 917 Bytes

Versions: 8

Compression:

Stored size: 917 Bytes

Contents

# encoding: utf-8
#
# One of the options that the <code>image</code> method accepts is
# <code>:at</code>. If you've read some of the graphics examples you are
# probably already familiar with it. Just provide it the upper-left corner where
# you want the image placed.
#
# While sometimes useful this option won't be practical. Notice that the cursor
# won't be moved after the image is rendered and there is nothing forbidding the
# text to overlap with the image.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  y_position = cursor
  text "The image won't go below this line of text."

  image "#{Prawn::DATADIR}/images/fractal.jpg", :at => [200, y_position]

  text "And this line of text will go just below the previous one."
end

Version data entries

8 entries across 8 versions & 2 rubygems

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