Created
November 23, 2017 19:01
-
-
Save stafast/584b02f0137fb21e5265d1a7cfd9169c to your computer and use it in GitHub Desktop.
TYPO3 PDF Merger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use setasign\Fpdi\Fpdi; | |
| -- -- -- -- | |
| header("X-Robots-Tag: noindex", true); | |
| $this->response->setHeader('Cache-control', 'public', TRUE); | |
| $this->response->setHeader('Content-Description', 'File transfer', TRUE); | |
| $this->response->setHeader('Content-Disposition', 'attachment; filename=students.pdf', TRUE); | |
| $this->response->setHeader('Content-type:application/pdf; charset=utf-8', TRUE); | |
| $this->response->sendHeaders(); | |
| require_once('fpdf/fpdf.php'); | |
| require_once('fpdi/src/autoload.php'); | |
| $pdf = new Fpdi(); | |
| $pdf->AddPage(); | |
| $pdf->setSourceFile('pdfs/1.pdf'); | |
| $tplIdx = $pdf->importPage(1); | |
| $pdf->useTemplate($tplIdx); | |
| $pdf->AddPage(); | |
| $pdf->setSourceFile('pdfs/2.pdf'); | |
| $tplIdx = $pdf->importPage(1); | |
| $pdf->useTemplate($tplIdx); | |
| $pdf->Output(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment