Sha256: fbfc6b97b34d278d6fd24f9ebc51889ac71b63bdadccd0bf37b57356fedf2e6b

Contents?: true

Size: 669 Bytes

Versions: 12

Compression:

Stored size: 669 Bytes

Contents

#!/usr/bin/env ruby
# coding: utf-8

$:.unshift(File.dirname(__FILE__) + "/../lib")

require 'pdf/wrapper'

pdf = PDF::Wrapper.new("table-fixed.pdf", :paper => :A4)
pdf.text File.read(File.dirname(__FILE__) + "/../specs/data/utf8.txt").strip, :alignment => :centre
pdf.pad 5
headers = %w{one two three four}

data = []
data << ["This is some longer text to ensure...",2,3,4]
data << ["This is some longer text to ensure...",2,3,4]

table = PDF::Wrapper::Table.new do |t|
  t.data = data
  t.headers = headers
  t.table_options :font_size => 10
  t.header_options :color => :white, :fill_color => :black
  t.manual_col_width [1,2,3], 25
end

pdf.table(table)
pdf.finish

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pdf-wrapper-0.4.5 examples/table_fixed_col_width.rb
pdf-wrapper-0.4.4 examples/table_fixed_col_width.rb
pdf-wrapper-0.4.1 examples/table_fixed_col_width.rb
pdf-wrapper-0.4.0 examples/table_fixed_col_width.rb
pdf-wrapper-0.3.5 examples/table_fixed_col_width.rb
pdf-wrapper-0.3.4 examples/table_fixed_col_width.rb
pdf-wrapper-0.3.3 examples/table_fixed_col_width.rb
pdf-wrapper-0.3.2 examples/table_fixed_col_width.rb
pdf-wrapper-0.3.1 examples/table_fixed_col_width.rb
pdf-wrapper-0.3.0 examples/table_fixed_col_width.rb
pdf-wrapper-0.2.0 examples/table_fixed_col_width.rb
pdf-wrapper-0.2.1 examples/table_fixed_col_width.rb