files = $files; } public function concat() { foreach($this->files AS $file) { $pageCount = $this->setSourceFile($file); for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) { $tplIdx = $this->ImportPage($pageNo); $s = $this->getTemplatesize($tplIdx); $this->AddPage($s['w'] > $s['h'] ? 'L' : 'P', array($s['w'], $s['h'])); $this->useTemplate($tplIdx); } } } } /* $pdf = new ConcatPdf(); $pdf->setFiles(array("samplepdfs/three.pdf", "samplepdfs/three.pdf", "samplepdfs/three.pdf")); $pdf->concat(); $pdf->Output('concat.pdf', 'I'); */