Welcome Guest, Not a member yet? Register   Sign In
How to call UMUM class in CI4?
#2

(This post was last modified: 07-05-2023, 08:40 AM by JustJohnQ. Edit Reason: add parameters for page size )

My fpdf (version 1.85) folder is in App\ThirdParty.
I added the following to autoload.php in config:
PHP Code:
public $classmap = [
        "FPDF"          => APPPATH "ThirdParty/fpdf/fpdf.php",
    ]; 

My test method looks like this:
PHP Code:
public function fpdfTest()
{
$this->pdf = new FPDF('P''mm''A4');
$this->pdf->AddPage();
$this->pdf->SetTextColor(42,80,125);
$this->pdf->SetFont('Helvetica','B',18);
$this->pdf->Text(15,12.5,"test");
$this->pdf->SetFont('Helvetica','B',14);
$this->response->setHeader('Content-Type','application/pdf');
$this->pdf->Output('D''Invoice_test.pdf');


A PDF is created and automatically saved/opened (depending on browser settings)
Reply


Messages In This Thread
How to call UMUM class in CI4? - by JayasSarea - 07-05-2023, 03:35 AM
RE: How to call UMUM class in CI4? - by JustJohnQ - 07-05-2023, 08:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB