-
-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setOptions method breaks image loading #793
Comments
I was stuck in the same problem. I added setOptions and the images not load anymore. |
The issue is that method setOptions resets ALL options to default values from vendor, including "chroot". That is directory, that Dompdf is allowed to access files from, which is in dompdf.php config file set to Laravel base path, but by setOptions it is reset to vendor root dir. Do not use setOptions unless you want set ALL of the options. Get current Options object and set what you need like this:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
When you set options, images are not loaded:
Controller:
View:
<img src="{{ public_path('images/certificate_tpl.jpg') }}">
Result:
Image not found or type unknown
If you remove the setOptions, the image is loaded.
Tested on: Laravel 8, Debian Linux, Laravel development server (php artisan serve), PHP 7.4.
The text was updated successfully, but these errors were encountered: