Add watermark to medical checkup report

This commit is contained in:
sas.fajri
2026-05-21 12:08:34 +07:00
parent e23751a5bd
commit 3a5dd605c2
2 changed files with 12 additions and 0 deletions

View File

@@ -6,6 +6,17 @@ class MedicalCheckupReportPdf extends FPDF
{
public $printBy = 'ADMIN';
public $branchAddress = '-';
public $watermarkPath = '';
public function Header()
{
if ($this->watermarkPath === '' || !file_exists($this->watermarkPath)) {
return;
}
// Draw watermark background per page.
$this->Image($this->watermarkPath, 23, 102, 164, 102, 'JPEG');
}
public function Footer()
{
@@ -91,6 +102,7 @@ class Medical_checkup_report extends MY_Controller
$pdf->AliasNbPages();
$pdf->printBy = $printBy;
$pdf->branchAddress = (string)$branch['branch_address'];
$pdf->watermarkPath = dirname(APPPATH) . '/assets/images/watermark-ibl.jpeg';
$pdf->AddPage();
// Header offset 3.5 cm for pre-printed kop.

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB