PHP code example of acucchieri / tcpdf-bundle

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

    

acucchieri / tcpdf-bundle example snippets

 php
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new AC\TcpdfBundle\ACTcpdfBundle(),
        ];

        // ...
    }
}
 php
$myPdf->toString();
 php
$data = [
  ['foo' => 'AAA', 'bar' => 123, 'baz' => '<b>text<b>'],
  ['foo' => 'BBB', 'bar' => 456, 'baz' => '<a href="https://domain.td">link</a>'],
  ['foo' => 'CCC', 'bar' => 789, 'baz' => '<ul><li>line 1</li><li>line 2</li></ul>'],
];

foreach ($data as $row) {
    $pdf->addRowCell([
      [$row['foo'], ['with' => 30]],
      [$row['bar'], ['width' => 40, 'align' => 'R']],
      [$row['baz'], ['width' => 50, 'is_html' => true]],
    ]);
}