PHP code example of jelix / tcpdf-module

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

    

jelix / tcpdf-module example snippets



class myCtrl extends jController {

    function index() {
        $resp = $this->getResponse('tcpdf');
        $resp->outputFileName = 'article.pdf';
        $resp->doDownload = true;

        // initialize the tcpdf object
        $resp->initPdf();
        $resp->tcpdf->AddPage();
        $resp->tcpdf->SetTitle('a title');
        $resp->tcpdf->Text(10,10,'a text');
        //...
        return $resp;
    }
}

class myCtrl extends jController {

    function index() {
        $resp = $this->getResponse('tcpdf');

        $resp->outputFileName = 'article.pdf';
        $resp->doDownload = true;

        // initialize the tcpdf object
        $resp->tcpdf = new MyTcPdf();
        $resp->tcpdf->AddPage();
        $resp->tcpdf->SetTitle('a title');
        $resp->tcpdf->Text(10,10,'a text');
        ...
        return $resp;
    }
}
bash
php yourapp/dev.php module:configure jtcpdf
bash
php yourapp/install/installer.php
bash
php yourapp/install/installer.php