From 2256f3477716f326c140c0a2bbaa5126776fabd3 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 24 Jul 2016 12:14:21 +1000 Subject: [PATCH] Fix setting of is remote enabled to work with DomPDF 0.7.0 --- CRM/Utils/PDF/Utils.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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(); -- 2.25.1