PDF not including external stylesheets or images. #662
-
Hi all, Got a bit of a strange one. I have a queue job that generates a PDF but external stylesheets and images are not being included. However, when running my queue locally via artisan it works. Also generating the PDF via a route in the browser works. Wondered if anyone else has come across this issue before. I hope it's me being a bit silly! Here is an example of how I'm calling Browsershot.
Finally here is the header for the PDF template blade file I'm using.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi @thursdaydan did you find the solution to this problem? |
Beta Was this translation helpful? Give feedback.
-
You have to use public_path, but not asset for CSS and JS to work. |
Beta Was this translation helpful? Give feedback.
-
You mentioned in the title that it wasn't rendering images, which is what I'm having an issue with. Even trying public_path, the image is broken. Anyone know how to get that working? |
Beta Was this translation helpful? Give feedback.
-
My issue was that my dev server has a username and password security rule in place to access the site. |
Beta Was this translation helpful? Give feedback.
You have to use public_path, but not asset for CSS and JS to work.