From 8cf0e42765e29c554e63f6751af1b3fc87ccaadb Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Tue, 18 Aug 2026 16:41:46 +0530 Subject: [PATCH] Activate discharge header with mPDF runtime API --- app/Controllers/Ipd_discharge.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Controllers/Ipd_discharge.php b/app/Controllers/Ipd_discharge.php index 45869b9..b69af72 100644 --- a/app/Controllers/Ipd_discharge.php +++ b/app/Controllers/Ipd_discharge.php @@ -7389,6 +7389,15 @@ class Ipd_discharge extends BaseController $mpdf->SetTitle('Discharge Summary - ' . ($patientName !== '' ? $patientName : ('IPD ' . $ipdId))); $mpdf->SetAuthor('Atria HMS'); + if ($withHeader && $headerHtml !== '') { + $mpdf->SetHTMLHeader($headerHtml, 'O', true); + $mpdf->SetHTMLHeader($headerHtml, 'E', true); + } + if ($footerHtml !== '') { + $mpdf->SetHTMLFooter($footerHtml, 'O', true); + $mpdf->SetHTMLFooter($footerHtml, 'E', true); + } + // Replicate the exact OPD template rendering pattern: @page CSS + named blocks + body in one WriteHTML call. $marginTopCm = (float) ($templateSettings['page_margin_top_cm'] ?? 0.8); $marginBottomCm = (float) ($templateSettings['page_margin_bottom_cm'] ?? 0.8);