Sha256: 98dadde33be5e308391e156ba2bf8e88b905e3ab3df958325fa6c07a219030ee

Contents?: true

Size: 967 Bytes

Versions: 8

Compression:

Stored size: 967 Bytes

Contents

# encoding: utf-8
#
# The document grid on Prawn is just a table-like structure with a defined
# number of rows and columns. There are some helpers to create boxes of content
# based on the grid coordinates.
#
# <code>define_grid</code> accepts the following options which are pretty much
# self-explanatory: <code>:rows</code>, <code>:columns</code>,
# <code>:gutter</code>, <code>:row_gutter</code>, <code>:column_gutter</code>
#
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
  # The grid only need to be defined once, but since all the examples should be
  # able to run alone we are repeating it on every example
  define_grid(:columns => 5, :rows => 8, :gutter => 10)
  text "We defined the grid, roll over to the next page to see its outline"

  start_new_page
  grid.show_all
end

Version data entries

8 entries across 8 versions & 2 rubygems

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