RoR Prawn PDF back of sheet

80 views Asked by At

I want to be able to put a default back of sheet on my generated PDF, has someone already did this ?

I was wondering if there is something in Prawn to do that, something like an event which is triggered when a new page has been started ?

I made many search about this and cannot see any way to do it, your help will be precious.

Here some code to show you the way I generate my PDF :

Prawn::Document.generate(invoice_file, :print_scaling => :none, :top_margin => margin_top) do |pdf|
        pdf.font_size=11
        pdf.define_grid(:columns => 12,:rows => 16, :gutter => 10)
        pdf.font "Helvetica"

        #some code to fill my pdf

        #And what I was trying to deal with it : 
        pdf.repeat(:all, :dynamic => true) do
            pdf.start_new_page
            #some code to fill my new page
        end
 end

This is almost working, I get the new created page but it's generating another blank page that I don't need, because of the new one I think. If someone has an idea, I take !

Thanks ! Flo.

0

There are 0 answers