使用 KnpSnappyBundle 生成 jpg 时没有资源 [英] no assets when generating jpg with KnpSnappyBundle
本文介绍了使用 KnpSnappyBundle 生成 jpg 时没有资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这似乎是一个已知问题,但我找不到解决方案:
This seems to be a know issue but I can't find a solution:
使用 KnpSnappyBundle 生成 jpg/pdf 时未加载 css 文件. 在 google 群组上,但没有提供答案.
css files are not being loaded when generating a jpg/pdf with KnpSnappyBundle. Here is a discussion on google groups, but no answer is provided.
有没有人找到解决这个问题的方法?
Has anyone found a solution to this issue?
推荐答案
回答有点晚,但我遇到了同样的问题,我使用绝对路径解决了这个问题,如下所示:
A little late for an answer but I had the same problem and I solved it using absolute paths for my assets like this:
<link rel="stylesheet" href="{{ app.request.scheme ~'://' ~ app.request.httpHost ~ asset('bundles/factura/css/all.css') }}">
希望能帮到你
这篇关于使用 KnpSnappyBundle 生成 jpg 时没有资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文