Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use setasign\Fpdi\Fpdi;
- require_once('fpdf181/fpdf.php');
- require_once('src/autoload.php');
- ////$pdf->Cell(0,10,'Enjoy new fonts with FPDF!');
- $pdf = new FPDI();
- $pageCount = $pdf->setSourceFile('foo.pdf');
- for ($i = 0; $i < $pageCount; $i++) {
- $tpl = $pdf->importPage($i + 1, '/MediaBox');
- $pdf->addPage();
- $pdf->useTemplate($tpl);
- $pdf->SetFont('Arial','',14);//B
- $pdf->Cell(40,10,'ID:test');
- }
- // iterate over array of files and merge
- // foreach ($files as $file) {
- // $pageCount = $pdf->setSourceFile($file);
- // for ($i = 0; $i < $pageCount; $i++) {
- // $tpl = $pdf->importPage($i + 1, '/MediaBox');
- // $pdf->addPage();
- // $pdf->useTemplate($tpl);
- // }
- // }
- $file_name="werilis_nomeri.pdf";
- // output the pdf as a file (http://www.fpdf.org/en/doc/output.htm)
- $pdf->Output();
- //$pdf->Output("D",$file_name,True);//'F','merged.pdf'
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement