Sha256: 8ee62df16a050332b5af5cc32a506d4477e42c43a60e59f1c8d9f3a7a111b401

Contents?: true

Size: 481 Bytes

Versions: 21

Compression:

Stored size: 481 Bytes

Contents

# encoding: utf-8
#
# Demonstrates how to enable absolute positioning in Prawn by temporarily
# removing the margin_box via Document#canvas()
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

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

21 entries across 21 versions & 7 rubygems

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