-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Description
Valign does not work. :top
ends up centered, :center
ends up at the bottom, and :bottom
ends up at the bottom correctly.
The original valign code was added in prawn:5cddc78a
I've written a small script that can be used to quickly test/iterate, for anyone out there who wants to try a fix. I am not a Ruby dev and there are no build instructions for this repo so I just slapped this together:
Build Environment
Project files:
main.rb
./prawn-table/ <----- clone of this repo
To rebuild the Gem with your changes, and rebuild the PDF:
cd ./prawn-table
rm prawn-table-*.gem && gem build prawn-table.gemspec
cd -
ruby main.rb
Contents of main.rb
:
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'prawn'
gem 'prawn-table', :path => './prawn-table'
end
Prawn::Document.generate('result.pdf') do
data = [ ["TOP", "", ""], ]
table data, :cell_style => { :valign => :top}
move_down 20
data = [ ["CENTER", "", ""], ]
table data, :cell_style => { :valign => :center}
move_down 20
data = [ ["BOTTOM", "", ""], ]
table data, :cell_style => { :valign => :bottom}
move_down 20
end
Results
The current codebase results in the following:
Simply commenting out prawn/table/cell/text.rb line 69 gives a better result in my opinion:
Metadata
Metadata
Assignees
Labels
No labels