首页 文章

邪恶的pdf没有渲染页脚

提问于
浏览
0

我正在开发一个使用wicked_pdf的项目,我有一个页脚部分,我在pdf生成中引用了:

format.pdf do
  render :pdf => "document",
    :footer => {
      :html => {
        :template => "/document/_footer"
      }
  }
end

当我运行它时,页脚没有显示在pdf上,但如果我在模板中有byebugs,我可以看到页脚正在处理,但没有应用到我的文档 . 任何帮助整理出来将非常感谢 .

1 回答

  • 2

    尝试设置保证金:

    format.pdf do
      render pdf: 'document',
             footer: { html: { template:"/document/_footer" },
             margin: { top: 10, left: 20, bottom: 15, right: 20 }
    end
    

相关问题