namespace App\Controllers;
use App\Libraries\FPDF;
class Test extends BaseController
{
function Header()
{
$this->Image('logo.png',90,15,36);
$this->SetFont('Arial','B',15);
$this->Cell(80);
$this->Cell(30,10,'Title',1,0,'C');
$this->Ln(20);
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
public function index()
{
$this->pdf = new fpdf();
$this->pdf->AliasNbPages();
$this->pdf->AddPage();
$this->pdf->SetFont('Times','',12);
$this->pdf->Image('logo.png',90,15,36);
$this->pdf->Cell(40,60,'Monthly Report');
$this->response->setHeader("Content-Type", "application/pdf");
$this->pdf->Output("file.pdf", 'I');
}
}