<?
App::import('Vendor', 'tcpdf/tcpdf');

App::import('Vendor', 'fpdi/fpdi');

class XFPDI extends FPDI {

    var $files = array();

    function setFiles($files) {
        $this->files = $files;
    }

    function concat() {
        foreach($this->files AS $file) {
            $pagecount = $this->setSourceFile($file);
            for ($i = 1; $i <= $pagecount; $i++) {
                 $tplidx = $this->ImportPage($i);
              
                 $this->AddPage();
                 $this->useTemplate($tplidx);
            }
        }
    }
    
}



