html2pdf icon indicating copy to clipboard operation
html2pdf copied to clipboard

how using html2pdf in codeigniter 3

Open fuller2010 opened this issue 3 years ago • 2 comments

// CONTROLLER

load->library('html2Pdf'); . . . } ?>

//application/libreries

pdf = $htmlpdf ; } }

fuller2010 avatar Oct 01 '20 16:10 fuller2010

  • If you don't have it, install Composer.
  • Create a composer.json file on the root of your project
  • Go through terminal to your project file and run composer require spipu/html2pdf. You will see your composer.json automatically filling with:
{
    "require": {
        "spipu/html2pdf": "^5.2"
    }
}
  • On config.php enable composer autolad setting this to TRUE.
  • Add the following line to your /index.php: require __DIR__ . '/vendor/autoload.php';
  • From your project root, through terminal, run composer install.
  • Go to the controller where you want to use html2pdf and add use Spipu\Html2Pdf\Html2Pdf; right after the <?php tag.

Now you can use html2pdf, you can try it by doing a controller function with the basic test code.

mperezv avatar Dec 29 '20 09:12 mperezv