【问题标题】:wicked_pdf does not include styleswicked_pdf 不包括样式
【发布时间】:2011-08-06 05:30:32
【问题描述】:

我用过 <%= wicked_pdf_stylesheet_link_tag "pdf" %> 它在 html 中显示以下输出

<link href="/stylesheets/pdf.css?1302860585" media="screen" rel="stylesheet" type="text/css"> <link href="file:///home/likewise-open/NEXTBRIDGE/nazar.hussain/osd/development/atlantis/public/stylesheets/pdf" media="screen" rel="stylesheet" type="text/css">

但是在创建 pdf 时它没有任何样式。如果我将文件中的所有 css 复制到页面的标题,它包括所有样式。问题是什么以及如何解决。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-plugins wicked-pdf


    【解决方案1】:

    我个人对这种方法没有任何问题,但我见过其他人有。

    我刚刚向主项目推送了一些更新,应该可以为您解决这个问题。

    wicked_pdf_stylesheet_link_tag 现在会将任何直接传入的 css 文件内联到标记中。

    我还更新了您创建的 Github 问题。

    【讨论】:

    • 我也用内联技术解决了这个问题。我在页面的head 标签中使用了&lt;%= render :file=&gt;path_to_css_file %&gt;。因此,这意味着您的最新提交也将解决问题。
    猜你喜欢
    • 2019-03-20
    • 2014-10-12
    • 1970-01-01
    • 2011-11-29
    • 1970-01-01
    • 2013-05-26
    • 2013-12-29
    • 1970-01-01
    • 2023-03-21
    相关资源
    最近更新 更多