DomPDF: Image not readable or empty
Stefan Izdrail
Founder & Senior Architect · 2026-06-29
Title: Troubleshooting DomPDF Image Rendering Issues: A Comprehensive Guideline for Developers
Body:
In the world of web development, there are several popular tools and frameworks for generating PDF files from HTML content. One such widely used tool is DomPDF. However, sometimes, you may encounter issues with rendering images within your generated PDF. This blog post aims to address this issue by providing a comprehensive guideline on troubleshooting the "Image not readable or empty" problem in DomPDF.
Firstly, make sure that DOMPDF_ENABLE_REMOTE is set to true. Setting this constant allows DomPDF to fetch images from remote sources during the rendering process. To verify the status of your configuration file, you can refer to the official documentation (https://laravelcompany.com/docs/dompdf) or similar guides for other frameworks.
Next, ensure that all necessary file permissions are granted accordingly. DomPDF needs read and write access to specific folders along with the images themselves. This is especially crucial if you're using a local setup and the images are stored on your server.
If both of these initial checks have been confirmed, it is essential to examine the image URLs in your HTML code. Images from remote sources can sometimes cause issues due to various reasons such as caching or security measures. In such situations, you might need to switch to local image storage or consider using a Content Delivery Network (CDN) for the images.
Here's an example:

