Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 53 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top