phantom-pdf
phantom-pdf copied to clipboard
CSS not loading over https
I have a laravel 5 site that was running in http but since they turned it to Https the css is not loading. The view produced is ok as i can see but the pdf does not have any styling (probably the css is not loaded). I see some previous issues that were solved. Where do i add the --ignore-ssl-errors=true setting?
Publish the config file by running php artisan vendor:publish
In the published config file, uncomment this line https://github.com/danielboendergaard/phantom-pdf/blob/master/src/config/config.php#L77
First of all thanks for the reply. I already changed the published config file "app/config/packages/danielboendergaard/phantom-pdf/config.php" and commented out the line you specified but it did not work. If I run php artisan vendor:publish will it affect other packages as well? is it necessary to run it if I already changed the published config file?
Actually I made a simple test without https and still the css styling is ignored. Only inline styles work. Can this be a version issue? What version do you recommend for Laravel 5?
Try setting the base_url here: https://github.com/danielboendergaard/phantom-pdf/blob/master/src/config/config.php#L27
Changed the base url but it did not work. Also tried a very simple css file in HTTP and still the css file is ignored although i see it in the produced html file.
Any other ideas? Does the library support css files at all?
The url used in the link tag must be reachable from the host machine itself. This can cause dns and https issues. It's probably easier to inline the css.
Alternatively I would take a look at one of these options: https://packagist.org/packages/barryvdh/laravel-dompdf https://packagist.org/packages/spatie/browsershot