Hi,
I've been struggling with an error that I can't comprehend!
I have a shared host and for my laravel site work I need an .htaccess file on root of public_html. It seems work really well for more than just this site.
But now, using this to generate pdf's if I use assets(images, css, etc) from external sources, I get the things right but if I use my own resources from the public folder, even using the url blade option, the asset blade option or the static path for the file it won't show anything like it can't be loaded.
Do you think that it is something with the .htaccess file?
This has ever happened to someone?
Best regards,
Jo茫o Lopes
Solved the problem using public_path method. Not the right way of doing things but it works!
I'm leaving the issue opened in case someone has another solution!
Somehow the underlying wkhtmltopdf needs know where to access your resources to render the pdf.
When you are generating a view, typically you'd use something like /js/bootstrap.min.js and it would resolve to <yourdomain>.com/js/boostrap.min.js.
You have two options that work. You can use public path as you did (might not work if you ever render that view as html instead of PDF, havent tested), or you resolve it to a URL manually.
If your method works for html views, I'd actually call it the best solution.
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
Solved the problem using public_path method. Not the right way of doing things but it works!
I'm leaving the issue opened in case someone has another solution!