P粉2441552772023-08-30 12:11:16
Since another answer suggested enabling the remote option in module.config.php
and I haven't been able to add a comment yet, I thought it would be best to answer that the file does not exist in newer versions of DomPDF.
If you need to include a remotely stored image in a newer version, you must pass it as an option to the constructor:
$dompdf = new Dompdf(array('enable_remote' => true));
This solved the problem I was having.
P粉8051077172023-08-30 00:27:54
The following helped me fall in love with glamour, at least locally, even with
define("DOMPDF_ENABLE_REMOTE", false);
The solution is to change the SRC of the image to the absolute path on the server, as follows:
<img src="/var/www/domain/images/myimage.jpg" />
All of the following worked for me:
<img src="<?php echo $_SERVER["DOCUMENT_ROOT"].'/placeholder.jpg';?>"/> <img src="<?php echo $_SERVER["DOCUMENT_ROOT"].'\placeholder.jpg';?>"/> <img src="<?php echo $_SERVER["DOCUMENT_ROOT"].'./placeholder.jpg';?>"/>
$_SERVER["DOCUMENT_ROOT"] is C:/wamp/www/ZendSkeletonApplication/public