PHP code example of jheferson-br / tpdf

1. Go to this page and download the library: Download jheferson-br/tpdf 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/ */

    

jheferson-br / tpdf example snippets


$unit = new SystemUnit($param['id']);
$pdf = new TPDF("P", 'mm', "A4");
$pdf->AliasNbPages();
$pdf->obj = $unit;

$pdf->header = function ($pd) {
	$pd->Image($pdf->obj->logo, 11, 12, 45, 15, '', '', true);
}

$pdf->footer = function ($pd) {
	$pd->SetFont('Arial', 'B', 14);
	$pd->Text(87,17,utf8_decode($pdf->obj->name));
}