PHP code example of skytrex / ci-dompdf

1. Go to this page and download the library: Download skytrex/ci-dompdf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

skytrex / ci-dompdf example snippets



defined('BASEPATH') OR exit('No direct script access allowed');

ilename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
  {
    $dompdf = new DOMPDF();
    $dompdf->loadHtml($html);
    $dompdf->setPaper($paper, $orientation);
    $dompdf->render();
    if ($stream) {
        $dompdf->stream($filename.".pdf", array("Attachment" => 0));
    } else {
        return $dompdf->output();
    }
  }
}

$autoload['libraries'] = array('pdf');

$autoload['helper'] = array('file');

$config['composer_autoload'] = FCPATH .'vendor/autoload.php';