prawnto

prawnto displaying tables that don't break when new page

夙愿已清 提交于 2019-12-03 08:08:46
I have a variable number of tables with variable number of rows and I want to have them displaying one after the other but if a table doesn't fit on the current page put it on the next then continue on. I have put the table in a transaction so I can roll back then print it if the height will fit on curent page but how do I get the table height? I have this code at the moment pdf.transaction do pdf.table @data, :font_size => 12, :border_style => :grid, :horizontal_padding => 10, :vertical_padding => 3, :border_width => 2, :position => :left, :row_colors => ["FFFFFF","DDDDDD"] pdf.move_down 20

Rails PDF Generation with Prawn in IE7

拟墨画扇 提交于 2019-11-30 10:31:28
I'm using Prawn and Prawnto to generate a PDF in a Ruby on Rails app (Rails version 2.2.2) which works great and generates PDFs happily and sends them to the user to download in Firefox. The problem is in IE7. I have a route set up like so: map.invoice_pdf '/invoices.pdf', :controller => 'invoices', :action => 'index', :format => 'pdf' Which I then have a link like so to call: invoice_pdf_path(:year => params[:year], :month => params[:month], :unpaid_only => params[:unpaid_only]) And the following in my controller: def index params[:year] = default params[:year] params[:month] = default params

Rails PDF Generation with Prawn in IE7

跟風遠走 提交于 2019-11-29 15:43:53
问题 I'm using Prawn and Prawnto to generate a PDF in a Ruby on Rails app (Rails version 2.2.2) which works great and generates PDFs happily and sends them to the user to download in Firefox. The problem is in IE7. I have a route set up like so: map.invoice_pdf '/invoices.pdf', :controller => 'invoices', :action => 'index', :format => 'pdf' Which I then have a link like so to call: invoice_pdf_path(:year => params[:year], :month => params[:month], :unpaid_only => params[:unpaid_only]) And the

header and footer in Prawn PDF

对着背影说爱祢 提交于 2019-11-28 16:32:56
I have read through all relevant posts on Prawn but found no mentioning (even in Prawn's own documentation) of headers and footers. However, I did see a demo on Prawnto's own website about headers and footers. I copied the entire source of that demo just to see if it works but an error of undefined method "header" is complained about. Am I to understand that Prawn took out header and footer recently in the gem or is there something else I need to do first to use header and footer? The demo page: http://cracklabs.com/prawnto/code/prawn_demos/source/text/flowing_text_with_header_and_footer the