Hi all, I have generated a pdf from a template. Tpl. tpl template converíi a. pdf with html2pdf library.
Now what I want is to take two or more. Pdf files created that way and make them into one. Pdf.
I'm trying with FPDF and FPDI basically is with the latter, trying to bring them together with a procedure, but
I generate a document with a blank sheet.
<?PHP
session_start();
// Turn up error reporting
error_reporting (E_ALL|E_STRICT);
/*
* Incluir Librerias FPDF
*/
require(APPLICATION_PATH . '/../library/fpdf/fpdf.php');
require(APPLICATION_PATH . '/../library/fpdi/fpdi.php');
ob_start();
class ConcatenarDocumentos extends FPDI
{
//private $_files = array();
var $_files = array();
public function setFiles($files) {
$this->_files = $files;
}
public function concat() {
foreach($this->files AS $file) {
$pagecount = $this->setSourceFile($file);
for ($i = 1; $i <= $pagecount; $i ) {
$tplidx = $this->ImportPage($i);
$s = $this->getTemplateSize($tplidx);
$this->AddPage($s['w'] > $s['h'] ? 'L' : 'P', array($s['w'], $s['h']));
$this->useTemplate($tplidx);
}
}
}
}
Thanks in advance.