From: Seamus Lee Date: Sun, 24 Jul 2016 02:14:21 +0000 (+1000) Subject: Fix setting of is remote enabled to work with DomPDF 0.7.0 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2256f3477716f326c140c0a2bbaa5126776fabd3;p=civicrm-core.git Fix setting of is remote enabled to work with DomPDF 0.7.0 --- diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index b22e3ae1a3..4c78d8d96b 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -25,12 +25,9 @@ +--------------------------------------------------------------------+ */ -// CRM-12165 - Remote file support required for image handling. -define("DOMPDF_ENABLE_REMOTE", TRUE); -define('DOMPDF_ENABLE_AUTOLOAD', FALSE); use Dompdf\Dompdf; - +use Dompdf\Options; /** * * @package CRM @@ -200,7 +197,11 @@ class CRM_Utils_PDF_Utils { * @return string */ public static function _html2pdf_dompdf($paper_size, $orientation, $html, $output, $fileName) { - $dompdf = new DOMPDF(); + // CRM-12165 - Remote file support required for image handling. + $options = new Options(); + $options->set('isRemoteEnabled', TRUE); + + $dompdf = new DOMPDF($options); $dompdf->set_paper($paper_size, $orientation); $dompdf->load_html($html); $dompdf->render();