diff --git a/app/Controllers/Ipd_discharge.php b/app/Controllers/Ipd_discharge.php index 646a965..2fc977e 100644 --- a/app/Controllers/Ipd_discharge.php +++ b/app/Controllers/Ipd_discharge.php @@ -7321,14 +7321,12 @@ class Ipd_discharge extends BaseController 'format' => ($templateSettings['page_size'] ?? 'A4') === 'CUSTOM' ? [max(20, (int) ($templateSettings['custom_width_mm'] ?? 210)), max(20, (int) ($templateSettings['custom_height_mm'] ?? 297))] : (string) ($templateSettings['page_size'] ?? 'A4'), - 'margin_left' => max(0, ((float) ($templateSettings['page_margin_left_cm'] ?? 0.8)) * 10), - 'margin_right' => max(0, ((float) ($templateSettings['page_margin_right_cm'] ?? 0.8)) * 10), - 'margin_top' => max(0, ((float) ($templateSettings['page_margin_top_cm'] ?? 0.8)) * 10), + 'margin_left' => max(0, ((float) ($templateSettings['page_margin_left_cm'] ?? 0.8)) * 10), + 'margin_right' => max(0, ((float) ($templateSettings['page_margin_right_cm'] ?? 0.8)) * 10), + 'margin_top' => max(0, ((float) ($templateSettings['page_margin_top_cm'] ?? 0.8)) * 10), 'margin_bottom' => max(0, ((float) ($templateSettings['page_margin_bottom_cm'] ?? 0.8)) * 10), - 'margin_header' => max(0, ((float) ($templateSettings['margin_header_cm'] ?? 0.5)) * 10), - 'margin_footer' => max(0, ((float) ($templateSettings['margin_footer_cm'] ?? 0.5)) * 10), - 'autoTopMargin' => 'stretch', - 'autoBottomMargin' => 'stretch', + 'margin_header' => max(0, ((float) ($templateSettings['margin_header_cm'] ?? 0.5)) * 10), + 'margin_footer' => max(0, ((float) ($templateSettings['margin_footer_cm'] ?? 0.5)) * 10), 'default_font' => 'freeserif', 'tempDir' => WRITEPATH . 'cache', ]); @@ -7338,20 +7336,44 @@ class Ipd_discharge extends BaseController $mpdf->SetTitle('Discharge Summary - ' . ($patientName !== '' ? $patientName : ('IPD ' . $ipdId))); $mpdf->SetAuthor('Atria HMS'); - $mpdf->SetHTMLFooter($footerHtml, 'O', true); - $mpdf->SetHTMLFooter($footerHtml, 'E', true); - $headerMarginMm = max(0, ((float) ($templateSettings['margin_header_cm'] ?? 0.5)) * 10); - $bodyHeaderHtml = $withHeader && $headerHtml !== '' - ? '