X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FPDF%2FUtils.php;h=f7dc760449e4427d7b694cf47e1f6f799e0ef6e3;hb=f28ac29c413280dc455dadca2d3a6da44b608a47;hp=b60466e4d2fcd518624b760b313d17af43d9edc1;hpb=4de9f9328a1b4a7daf9802bdb6a6d9989b554fe8;p=civicrm-core.git diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index b60466e4d2..f7dc760449 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -124,6 +124,17 @@ class CRM_Utils_PDF_Utils { } } + /** + * Convert html to tcpdf. + * + * @param $paper_size + * @param $orientation + * @param $margins + * @param $html + * @param $output + * @param $fileName + * @param $stationery_path + */ public static function _html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path) { // Documentation on the TCPDF library can be found at: http://www.tcpdf.org // This function also uses the FPDI library documented at: http://www.setasign.com/products/fpdi/about/ @@ -179,8 +190,11 @@ class CRM_Utils_PDF_Utils { * @return string */ public static function _html2pdf_dompdf($paper_size, $orientation, $html, $output, $fileName) { - require_once 'packages/dompdf/dompdf_config.inc.php'; - spl_autoload_register('DOMPDF_autoload'); + // CRM-12165 - Remote file support required for image handling. + define('DOMPDF_ENABLE_REMOTE', TRUE); + define('DOMPDF_ENABLE_AUTOLOAD', FALSE); + require_once 'vendor/dompdf/dompdf/dompdf_config.inc.php'; + $dompdf = new DOMPDF(); $dompdf->set_paper($paper_size, $orientation); $dompdf->load_html($html); @@ -224,10 +238,9 @@ class CRM_Utils_PDF_Utils { } } - /* - * convert value from one metric to another - */ /** + * convert value from one metric to another. + * * @param $value * @param $from * @param $to @@ -302,7 +315,7 @@ class CRM_Utils_PDF_Utils { * @param string $author * @param string $title */ - static function &pdflib( + public static function &pdflib( $fileName, $searchPath, &$values, @@ -406,4 +419,5 @@ class CRM_Utils_PDF_Utils { CRM_Core_Error::statusBounce("PDFlib Error: " . $excp->get_errmsg()); } } + }