File: flow_and_header.rb

package info (click to toggle)
ruby-prawn-table 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 440 kB
  • ctags: 223
  • sloc: ruby: 3,343; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# encoding: utf-8
#
# If the table cannot fit on the current page it will flow to the next page just
# like free flowing text. If you would like to have the first row treated as a
# header which will be repeated on subsequent pages set the <code>:header</code>
# option to true.
#
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
  data = [["This row should be repeated on every new page"]]
  data += [["..."]] * 30

  table(data, :header => true)
end