From 6259001aec091912653901112e875dc077777c00 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 6 Jun 2026 04:19:20 +0530 Subject: [PATCH] Fix emoji rendering issue - use PDF-safe symbols instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROBLEM: Emojis don't render in PDF (showing as empty boxes) SOLUTION: - Use down-pointing triangle (▼) using HTML entity ▼ - This Unicode character renders properly in mPDF/PDF generators - Darker gray background (#cccccc) for better B&W visibility - Bold 3px border on selected box - Larger font and padding for selected number Visual indicators that work in B&W printing: - Triangle (▼) above selected level - Dark gray shading on selected box - Bold border on selected box - Bold text for selected label --- app/Controllers/Opd.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php index 8282395..8acc0aa 100644 --- a/app/Controllers/Opd.php +++ b/app/Controllers/Opd.php @@ -3880,32 +3880,31 @@ class Opd extends BaseController if ($painImageHtml === '' && $painIndex !== null) { $labels = ['No Pain', 'Mild', 'Moderate', 'Intense', 'Worst']; - $emojis = ['😊', '😐', '😣', '😖', '😭']; // Visual indicators for black & white printing // Add debug info at top showing which pain level is selected $painImageHtml = '
Pain Level: ' . $painIndex . ' - ' . esc($labels[$painIndex]) . '
'; $painImageHtml .= ''; - // Row 1: Emoji indicators (visible in black & white printing) + // Row 1: Arrow/checkmark indicators (PDF-safe symbols, visible in black & white) $painImageHtml .= ''; for ($i = 0; $i <= 4; $i++) { $active = ($painIndex === $i); - $emoji = $active ? $emojis[$i] : ' '; - $fontSize = $active ? '24px' : '16px'; - $painImageHtml .= ''; + $indicator = $active ? '▼' : ''; // Down-pointing triangle (▼) + $fontSize = $active ? '18px' : '12px'; + $painImageHtml .= ''; } $painImageHtml .= ''; - // Row 2: Number boxes with bold border for selected (visible in B&W) + // Row 2: Number boxes with bold border and shading for selected (visible in B&W) $painImageHtml .= ''; for ($i = 0; $i <= 4; $i++) { $active = ($painIndex === $i); - $bg = $active ? '#e5e5e5' : '#ffffff'; // Light gray for selected (visible in B&W) + $bg = $active ? '#cccccc' : '#ffffff'; // Medium gray for selected (visible in B&W) $borderColor = '#000000'; $borderWidth = $active ? '3px' : '1px'; $color = '#000000'; - $painImageHtml .= ''; + $painImageHtml .= ''; } $painImageHtml .= '';
' . $emoji . '' . $indicator . '
' . $i . '' . $i . '