PHP code example of xarenisoft / dpdf

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

    

xarenisoft / dpdf example snippets


$pdf = new DPDF();
$pdf->AddPage();
$pdf->SetFont("Arial", "", 9);
//header
$pdf->Table(DPDF::Horizontal(['weight'=>100,'border'=>'B'],
    [
        DPDF::Cello(['text'=>'Id']),
        DPDF::Cello(['text'=>'Name']),
        DPDF::Cello(['text'=>'Age']),
        DPDF::Cello(['text'=>'Amount'])
    ]
   )
);
$pdf->Ln();

$pdf->Table(DPDF::Horizontal(['weight'=>100],
    [
        DPDF::Cello(['text'=>'1']),
        DPDF::Cello(['text'=>'JAN']),
        DPDF::Cello(['text'=>'10']),
        DPDF::Cello(['text'=>'$1010'])
    ]
   )
);


$pdf->Output(rand()."pdf.pdf",'F');