You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I faced the problem with loading image as seen in this issue.
All fixes were made without any success. But after a repairing night, the solution come to me, so I would like to share it with you.
I've read lot of issues here and on DomPDF repo as well.
I saw on the DomPDF options that ext_curl or allow_url_fopen should be enabled, so images where not loaded directly by the web server but by the PHP engine.
And because I'm using docker with to separate container it could nerver work.
This couldn't be fix on the package but a notice can be set.
Using docker-compose on {{ absolute_url(asset( <image path> )) }} I just replace the host (localhost in my case) with the "linked" container name (web in my case).
A simple {{ absolute_url(asset( <image path> ))|replace({'localhost': 'web'}) }} fix my problem.
In fact this solution should be per project, I personally create a Twig extension that replace it only on Dev env.
The text was updated successfully, but these errors were encountered:
Question and answer
Hello, I faced the problem with loading image as seen in this issue.
All fixes were made without any success. But after a repairing night, the solution come to me, so I would like to share it with you.
I've read lot of issues here and on DomPDF repo as well.
I saw on the DomPDF options that
ext_curl
orallow_url_fopen
should be enabled, so images where not loaded directly by the web server but by the PHP engine.And because I'm using docker with to separate container it could nerver work.
This couldn't be fix on the package but a notice can be set.
Using docker-compose on
{{ absolute_url(asset( <image path> )) }}
I just replace the host (localhost in my case) with the "linked" container name (web in my case).A simple
{{ absolute_url(asset( <image path> ))|replace({'localhost': 'web'}) }}
fix my problem.In fact this solution should be per project, I personally create a Twig extension that replace it only on Dev env.
The text was updated successfully, but these errors were encountered: