【问题标题】:PDFkit ignore footer?PDFkit忽略页脚?
【发布时间】:2013-08-15 09:27:18
【问题描述】:

我在我的应用程序中安装了PDFKit gem,如果我在我的任何网址上调用 .pdf,它会生成页面的 pdf 版本。

config.middleware.use PDFKit::Middleware,
    :page_size => 'A4',
    :margin_top => '0.39in',
    :margin_right => '0.39in',
    :margin_bottom => '0.39in',
    :margin_left => '0.39in',:print_media_type => true

在我的application.rb 文件中设置,但是当页面以 pdf 呈现时,我有一个固定的页脚在元素之间跳转有没有办法排除它,以便 PDF 工具包忽略它?

【问题讨论】:

    标签: ruby-on-rails wkhtmltopdf pdfkit


    【解决方案1】:

    您是否尝试过专门为打印媒体类型添加 css 并将页脚设置为不显示?比如:

    @media print {  
      #footer {  
            display: none;  
        }  
    }  
    

    【讨论】:

    • 你的传奇人物。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-15
    • 1970-01-01
    • 2015-06-29
    • 2021-09-06
    相关资源
    最近更新 更多