I want to display pdf from view> That is a blade view, but when i put in this view asset like pictures with {{ asset(...) }} My pdf don't display and i have a timeout error.
So i ask how can i generate pdf with images.
Thanks
Do like this :
<div class="col-xs-6">
<img src="{{public_path($data->imagePath)}}">
</div>
Are you using a real web server? Php built in server doesn't work with concurrent requests.
I am using php artisan serve in local
But i tried too in my godaddy webserver and it is the same for the stlesheet
I use an image in a PDF that i generate with this package. I believe it works best if you use the full URL (ex. http://www.mydomain.com/lib/images/pic.png )
To me worked in one way (using public_path):
CSS :
<link rel="stylesheet" href="{{public_path('css/name.css')}}">
IMG :
<img alt="Logo" src="{{public_path(filename.extension)}}"/>
I can confirm that mprandot's solution works
Works for me too. Before 06/17 it works with "asset", I was thinking that it was a server error for a month (stops working in two server at same time).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy.
If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
Most helpful comment
Do like this :