Sha256: b3129475195b2ca293ea9717c4590c469d810acd543e9855659180736da60747

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

# encoding: utf-8
#
# Demonstrates how to enable absolute positioning in Prawn by temporarily
# removing the margin_box via Document#canvas()
#
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
require "prawn"

Prawn::Document.generate("canvas.pdf") do
  canvas do
    text "This text should appear at the absolute top left"

    # stroke a line to show that the relative coordinates are the same as absolute
    stroke_line [bounds.left,bounds.bottom], [bounds.right,bounds.top]
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
kavu-prawn-core-0.4.100 examples/general/canvas.rb
kavu-prawn-core-0.4.99 examples/general/canvas.rb
prawn-0.3.0 examples/general/canvas.rb
prawn-0.4.0 examples/general/canvas.rb
prawn-0.4.1 examples/general/canvas.rb