Further fixes to ensure that images are supported and to trim filename of extension...
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 17 Sep 2016 22:00:20 +0000 (22:00 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Sat, 17 Sep 2016 22:00:20 +0000 (22:00 +0000)
CRM/Contribute/Form/Task/Invoice.php
CRM/Utils/PDF/Utils.php

index 65e916864b84b4d9ffc13886350e370eaae3453b..fb637b3406789fffeda400a92063694327b293cf 100644 (file)
@@ -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();
index aa6e4ae882a76e0d7f8c7b1387061075494f634a..cf3272b0c26a05920f6ab4afd269fcc5cdf63ffc 100644 (file)
@@ -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);
     }
   }