i am having trouble with an image AND external font in mij pdf header.
on localhost never a problem, but on the test and live server there is SOMETIMES a problem that the logo image and text that uses external font don't show up.
I tried using base64 instead of image. but still, sometimes it shows and sometimes not..
any idea's?
same issue, ever resolve it?
I found a quick and dirty solution to this, I'm sure there are better ways, but for anyone on a deadline, here you go.
I had 2 situations, 1. images not showing at all on the production server when ubuntu 16.04.3 and CSS not being loaded.
I have tons of CSS and views change, and I don't want to deal with coding 2 versions of each Object. So I switched from using PDF::loadView to PDF::loadFile. For whatever reason, loadView happens so fast possibly there is a race condition where the browser is not ready to render the images or the javascript. loadfile will load the whole file, presumably waiting for the render process to finish.
The caveat. If you are running this in an authenticated space or authorized space. You'll have to write a tmp file or add some token authentication that can be used one time and discarded so that you can hit a route that would normally be private publicly. Note even if you are logged in and authorized, wkhtmltopdf is going to run in it's own process and won't be.
Your images and fontawesome fonts and everything else will render perfectly regardless of what system you are running.
For wkhtmltopdf to render an https asset. or load an https file, thats another issue.
You need to downgrade you libssl to the right version (at the time of this writing). I think thats for ubuntu only but I'm not sure. Refer to this issue to solve that problem.
Hi, I also experienced the same issue when I'm usingasset() to render images and if the image loaded from secured connection. I have a work around here, but not sure why it works. If you're trying to load/render image from the local files, just use the public_path() to load the image, and it will work even with ssl.
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
Hi, I also experienced the same issue when I'm using
asset()to render images and if the image loaded from secured connection. I have a work around here, but not sure why it works. If you're trying to load/render image from the local files, just use thepublic_path()to load the image, and it will work even with ssl.