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
Images not showing on production but they do on local environment #19
Comments
The problem was that mpdf doesn't understand well relative paths for images, even if the web browser is fine with them and display the images correctly. The fix was to generate a path with an absolute base URL, in this case, by setting the second parameter of the "Url::to" function to true, as per the documentation.
I hope this helps others having the same issue. Thank you. |
The absolute URL didn't solve this problem to me. But using base64 image instead solve it. |
I had the same problem. The absolute URL and base64 -- didn't work. |
My problem was a different one and i had problem in local server as well as in the hosting server. I solved problem with a shortcut that I copied the images to web folder instead of database. After the change the application worked without issues. |
The absolute URL and base64 -- didn't work me too. I install php5-gd and this solved my problem. |
HI, just try to install php7.0-gd |
Hi, just clean browser history or update browser. |
Inside the MPDF directory there is a subdirectory "tmp", you need to give write permissions to it. |
i have problem in uploading the img in yii2, my yii2 framework is in latest version. And i have uploaded some img in home page using code (src="img/product.jpg") and it's working but when i click on another page and come back to the home page , the img is not displaying and it needs code (src="../img/product.jpg") to display it on home page. so why is that? please help me solve this problem. |
I had a same problem because of SSL error! |
Hello, I have a couple of simple PNG images in a view print.php, like this:
In the local environment, the images shows fine in the generated PDF and even if I just print it without PDF (controller code):
However, on the production server, the images are not showing. They show only if I print the view without PDF (like in the previous code), so for me this means that the images are fine, no broken links (because they show on renderPartial) and leads me to think that there might be some issue with the mpdf?
The generated PDF in the production server shows a red "X" where the image should be loaded. How can I troubleshoot this? Can the PDF be examined? If it was an HTML page I would check where the link in "src" is leading, but in the PDF I'm not sure how to proceed.
Local environment is PHP 5.5 and production is PHP 5.6. Does this has something to do?
Any help will be really welcomed and appreciated!
The text was updated successfully, but these errors were encountered: