Sha256: 31fce096b0fb10103483ad4b786cf57f229e7c6035567f9180dd0ee21f984e31

Contents?: true

Size: 507 Bytes

Versions: 7

Compression:

Stored size: 507 Bytes

Contents

# encoding: utf-8    

require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate('column_gutter_grid.pdf') do |p|
  p.define_grid(:columns => 3, :rows => 10, :column_gutter => 10)
  
  p.grid.rows.times do |i|
    p.grid.columns.times do |j|
      b = p.grid(i,j)
      p.bounding_box b.top_left, :width => b.width, :height => b.height do
        p.text b.name
        p.stroke do
          p.rectangle(p.bounds.top_left, b.width, b.height)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
prawn-0.11.1.pre examples/grid/column_gutter_grid.rb
jyurek-prawn-layout-0.8.4 examples/grid/column_gutter_grid.rb
prawn-layout-0.8.4 examples/grid/column_gutter_grid.rb
prawn-layout-0.7.2 examples/grid/column_gutter_grid.rb
prawn-layout-0.7.1 examples/grid/column_gutter_grid.rb
prawn-layout-0.3.2 examples/grid/column_gutter_grid.rb
prawn-layout-0.3.1 examples/grid/column_gutter_grid.rb