From 2d01402f978409c0f45cf5f6248078795ae6e673 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 17 Sep 2016 22:00:20 +0000 Subject: [PATCH] Further fixes to ensure that images are supported and to trim filename of extension as per CRM-19183 --- CRM/Contribute/Form/Task/Invoice.php | 2 +- CRM/Utils/PDF/Utils.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index 65e916864b..fb637b3406 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -653,7 +653,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task { $options = new Options(); $options->set('isRemoteEnabled', TRUE); - $doc = new DOMPDF(); + $doc = new DOMPDF($options); $doc->load_html($html); $doc->render(); $html = $doc->output(); diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index aa6e4ae882..cf3272b0c2 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -202,7 +202,7 @@ class CRM_Utils_PDF_Utils { $options = new Options(); $options->set('isRemoteEnabled', TRUE); - $dompdf = new DOMPDF(); + $dompdf = new DOMPDF($options); $dompdf->set_paper($paper_size, $orientation); $dompdf->load_html($html); $dompdf->render(); @@ -211,6 +211,8 @@ class CRM_Utils_PDF_Utils { return $dompdf->output(); } else { + // CRM-19183 remove .pdf extension from filename + $fileName = basename($fileName, ".pdf"); $dompdf->stream($fileName); } } -- 2.25.1