Hey :-) Make sure that you reference the full filesystem path to the CSS and not the full path on the webserver.
Using Knp-Snappy with Laravel Homested -- css file not working?
Hey all, I've got a view that I'm trying to render to a pdf with knp-snappy. I'm using laravel-snappy and everything seems to work as long as I don't have a CSS file included in my view / layout.
The Problem When I include css with something like below it doesn't work:
<head>
{{ HTML::style('path/to/file.css') }}
</head>
It just says pdf could not be generated or something similar.
When I inline all of my css inline like this, it works great:
<head>
<style type="text/css">/* my css here */</style>
</head>
I found this thread in which OP seems to be having the same issue. The solution seems less than ideal though. I'd rather not 'inject' the contents of my css file into my view since that seems a bit hacky. Has anyone else ran into this issue?
Note that I am running on a homestead environment and viewing the site via a url like http://mysite.dev:8000/pdf. Perhaps port 8000 is throwing snappy off? I have already confirmed the css file is being included with an absolute (full-url) path when the view is rendered. Also, I'm able to render the view just fine (sans pdf) without inlining the css, it seems to be a problem isolated to generating the pdf and not finding the css file is causing it to choke.
Thanks in advance to anyone who might have some knowledge about this!
Update: I created a github issue related to this on the wrapper repository. Not sure where the issue lies exactly but will report back here with any further progress.
Please or to participate in this conversation.