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
To be able to render remote images locally. #2256
base: master
Are you sure you want to change the base?
Conversation
Can you provide a bit more context? I've been able to render that type of image reference without issue. Also, I think this could break rendering |
Usually we put the image files in the document root of the web server. So these files can be accessed from the browser just with a url like: |
Here is an example: https://github.com/amouhzi/symfony-dompdf-demo |
I'll have to think through this scenario a bit more. |
any news about this ? |
Nothing yet. I'm not entirely opposed to the idea I just need to think about the implementation. A few comments/questions:
Regarding the example of loading "/image.png" ... one way to accommodate this without any changes would be to set the base href to the site domain. Then "/image.png" gets interpreted as "http://example.com/image.png". The only drawback is that it does incur a bit of a performance penalty in having to load the resource through the web server instead of using local file access. |
FYI in thinking through this some more it's probably a useful option to specify actual chroot-like functionality, but it's going to require more work thank done here since you're co-opting the functionality around the (poorly named) existing chroot option. |
This Pull Request allows us to load local images accessible in the browser and which are stored in the root document:
Example: