Advertisement
Guest User

Untitled

a guest
Dec 7th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. use setasign\Fpdi\Fpdi;
  5.  
  6. require_once('fpdf181/fpdf.php');
  7. require_once('src/autoload.php');
  8.  
  9. ////$pdf->Cell(0,10,'Enjoy new fonts with FPDF!');
  10.  
  11.  
  12. $pdf = new FPDI();
  13.  
  14. $pageCount = $pdf->setSourceFile('foo.pdf');
  15. for ($i = 0; $i < $pageCount; $i++) {
  16.     $tpl = $pdf->importPage($i + 1, '/MediaBox');
  17.     $pdf->addPage();
  18.     $pdf->useTemplate($tpl);
  19.     $pdf->SetFont('Arial','',14);//B
  20.     $pdf->Cell(40,10,'ID:test');
  21. }
  22. // iterate over array of files and merge
  23. // foreach ($files as $file) {
  24. //     $pageCount = $pdf->setSourceFile($file);
  25. //     for ($i = 0; $i < $pageCount; $i++) {
  26. //         $tpl = $pdf->importPage($i + 1, '/MediaBox');
  27. //         $pdf->addPage();
  28. //         $pdf->useTemplate($tpl);
  29. //     }
  30. // }
  31.  
  32. $file_name="werilis_nomeri.pdf";
  33.    
  34. // output the pdf as a file (http://www.fpdf.org/en/doc/output.htm)
  35. $pdf->Output();
  36. //$pdf->Output("D",$file_name,True);//'F','merged.pdf'
  37.  
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement