00cong.com      


  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI4 PDF Customized

#1
Goodmorning everyone,
i am using codeigniter version 4 rc3.
I should create pdfs but I have to customize them, this is to say that they are not like the web page displayed.
Which library do you recommend to use.
I with codeigniter 3 used fpdf.
Which is very customizable.
Since I'm doing a new project I ask, which pdf library integrates with codeigniter 4 and allows me to customize the reports I had to build by taking data from the database.
Thank you
Reply

#2
One of the best is TCPDF you may want to try that one there is a new version in the works.
What did you Try? What did you Get? What did you Expect?

Joined 00cong.community 2009.  ( Skype: insitfx )
Reply

#3
(02-08-2020, 05:51 AM)InsiteFX Wrote: One of the best is TCPDF you may want to try that one there is a new version in the works.

I built this library,

in App \\ Libraries \\Pdf.php

PHP Code:
<?php 

require_once dirname(__FILE__) . '/TCPDF-master/tcpdf.php';

class 
Pdf extends TCPDF
{
    function __construct()
    {
        parent::__construct();
    }
}

/* End of file Pdf.php */
/* Location: ./app/libraries/Pdf.php */ 

in Home_1 controller i call this.

PHP Code:
<?php namespace App\Controllers;

use 
App\Libraries\Pdf;

class 
Home_1 extends BaseController
{
    
    
function __construct(){       
    
}
        
    
public function index()
    {
            $pdf = new Pdf(); 

but it gives me a mistake
Class 'App\Libraries\Pdf' not found

thanks
Reply

#4
(02-08-2020, 07:01 AM)gra Wrote:
(02-08-2020, 05:51 AM)InsiteFX Wrote: One of the best is TCPDF you may want to try that one there is a new version in the works.

I built this library,

in App \\ Libraries \\Pdf.php

PHP Code:
<?php 

require_once dirname(__FILE__) . '/TCPDF-master/tcpdf.php';

class 
Pdf extends TCPDF
{
    function __construct()
    {
        parent::__construct();
    }
}

/* End of file Pdf.php */
/* Location: ./app/libraries/Pdf.php */ 

in Home_1 controller i call this.

PHP Code:
<?php namespace App\Controllers;

use 
App\Libraries\Pdf;

class 
Home_1 extends BaseController
{
    
    
function __construct(){       
    
}
        
    
public function index()
    {
            $pdf = new Pdf(); 

but it gives me a mistake
Class 'App\Libraries\Pdf' not found

thanks
solved it was a concept related to php7:

PHP Code:
<?php 
namespace App\ThirdParty;

use 
TCPDF
Reply

#5
Glad you got it to work, enjoy now.
What did you Try? What did you Get? What did you Expect?

Joined 00cong.community 2009.  ( Skype: insitfx )
Reply

#6
Hello gra !

By the way, FDPF is still working with CI4 ;-)
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By , © 2002-2020 .