Created
September 10, 2010 10:32
-
-
Save HHRy/573423 to your computer and use it in GitHub Desktop.
Strange behaviour with Prawn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'prawn' | |
| pdf = Prawn::Document.new(:page_size => "A4", :page_layout => :landscape) | |
| pdf.bounding_box [0, pdf.bounds.height - 40,], :width => 740 do | |
| # No Entries | |
| # | |
| pdf.table([["Total Value of Spend", "Total Transactions", "Average Transaction Value"], ["4558.5100", "30", "151.95033333"]], :header => true) do | |
| row(0).style(:style => :bold, :background_color => 'cccccc') | |
| end | |
| pdf.move_down(10) | |
| # Works | |
| # | |
| pdf.table([["Total Value of Spend", "Total Transactions", "Average Transaction Value"], ["4558.5100", "30", "151.95033333"]]) | |
| pdf.move_down(10) | |
| # Works. | |
| # | |
| pdf.table([["Total Value of Spend", "Total Transactions", "Average Transaction Value"], ["4558.5100", "30", "151.95033333"]], :header => true, :cell_style => { :borders => [] }) | |
| pdf.move_down(10) | |
| # Suddenly Works | |
| # | |
| pdf.table([["Total Value of Spend", "Total Transactions", "Average Transaction Value"], ["4558.5100", "30", "151.95033333"]], :header => true) do | |
| row(0).style(:style => :bold, :background_color => 'cccccc') | |
| end | |
| end | |
| pdf.render_file('test.pdf') |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Removing the Bounding box solves the problem