$orientation = CRM_Core_BAO_PdfFormat::getValue('orientation', $format);
$metric = CRM_Core_BAO_PdfFormat::getValue('metric', $format);
$t = CRM_Core_BAO_PdfFormat::getValue('margin_top', $format);
- $r = CRM_Core_BAO_PdfFormat::getValue('margin_right', $format);
+ $r = CRM_Core_BAO_PdfFormat::getValue('margin_right', $format);
$b = CRM_Core_BAO_PdfFormat::getValue('margin_bottom', $format);
$l = CRM_Core_BAO_PdfFormat::getValue('margin_left', $format);
$stationery_path_partial = CRM_Core_BAO_PdfFormat::getValue('stationery', $format);
$stationery_path = NULL;
- if(strlen($stationery_path_partial)) {
- $doc_root = $_SERVER['DOCUMENT_ROOT'];
- $stationery_path = $doc_root."/".$stationery_path_partial;
+ if (strlen($stationery_path_partial)) {
+ $doc_root = $_SERVER['DOCUMENT_ROOT'];
+ $stationery_path = $doc_root . "/" . $stationery_path_partial;
}
$margins = array($metric,$t,$r,$b,$l);
// Strip <html>, <header>, and <body> tags from each page
$htmlElementstoStrip = array(
'@<head[^>]*?>.*?</head>@siu',
+ '@<script[^>]*?>.*?</script>@siu',
'@<body>@siu',
'@</body>@siu',
'@<html[^>]*?>@siu',
$paper_size_arr = array( $paper_size[2], $paper_size[3]);
- // print_r( $paper_size_arr );
- $pdf = new TCPDF($orientation, 'pt', $paper_size_arr, 'UTF-8', FALSE);
+ $pdf = new TCPDF($orientation, 'pt', $paper_size_arr);
$pdf->Open();
if (is_readable($stationery_path)){
$reset_parm = false;
$cell = false;
$align = '' ;
- //print $html;
+
// output the HTML content
$pdf->writeHTML($html, $ln, $fill, $reset_parm, $cell, $align);
$pdf_file = 'CiviLetter'.'.pdf';
$pdf->Output($pdf_file, 'D');
CRM_Utils_System::civiExit(1);
-
}
/**