Method: Prawn::Document#header

Defined in:
lib/barkest_core/extensions/prawn_document_extensions.rb

#header(height, *columns) ⇒ Object

Creates a header row for a page.

The text is 20pt and bold. The height would be the height you want your header row to be in percent. 4 is a good starting point for portrait.



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/barkest_core/extensions/prawn_document_extensions.rb', line 162

def header(height, *columns)
  columns = columns.to_a.map{ |v| preprocess_table_data(v) }
  layout column: 1, row: 1, fill_width: true, height: height do
    table [
              # row 1
              columns
          ],
          width_ratio: 1.0,
          cell_style: {
              borders: [ :bottom ],
              border_width: 1.5,
              padding: [ 0, 0, 0, 0 ],
              font_style: :bold,
              size: 20
          }
  end
end