wicked_pdf: footer height/styling

前端 未结 1 542
情书的邮戳
情书的邮戳 2021-01-05 06:51

I\'m using the awesome wicked_pdf gem to generate a PDF, but I can\'t figure out how to change certain styles within the footer.

I\'m having a HAML template for the

相关标签:
1条回答
  • 2021-01-05 07:13

    You'll have to adjust the bottom margin of the PDF to make room for the footer if it is over a certain size.

    respond_to do |format|
      format.pdf do
        render :pdf => 'some_pdf',
               :margin => { :bottom => 30 },
               :footer => { :html => { :template => 'pdfs/footer.pdf.erb' } }
      end
    end
    

    or you can throw that margin value in your config/initializers/wicked_pdf.rb file if it is a site-wide thing.

    0 讨论(0)
提交回复
热议问题