【发布时间】:2012-05-18 13:30:09
【问题描述】:
这似乎是一个已知问题,但我找不到解决方案:
使用 KnpSnappyBundle 生成 jpg/pdf 时未加载 css 文件。 Here is a discussion 在 google 群组上,但没有提供答案。
有没有人找到解决这个问题的方法?
【问题讨论】:
标签: symfony
这似乎是一个已知问题,但我找不到解决方案:
使用 KnpSnappyBundle 生成 jpg/pdf 时未加载 css 文件。 Here is a discussion 在 google 群组上,但没有提供答案。
有没有人找到解决这个问题的方法?
【问题讨论】:
标签: symfony
回答有点晚了,但我遇到了同样的问题,我使用绝对路径为我的资产解决了这个问题,如下所示:
<link rel="stylesheet" href="{{ app.request.scheme ~'://' ~ app.request.httpHost ~ asset('bundles/factura/css/all.css') }}">
希望对你有帮助
【讨论】:
github 上有一个“解决方法”,但它仍在合并请求中: 目前我认为这是最好的解决方案
$this->get('knp_snappy.pdf')->getOutput()
而不是
$this->get('knp_snappy.pdf')->getOutputFromHtml()
【讨论】: