title: How to add text into an existing PDF using PHP?
body: <p>I need to add a small text so that it is in the footer of my PDF file. I am trying following code:</p>
  
  <pre><code>    require_once('pdf/fpdf/fpdf.php');
      require_once('pdf/fpdi/Fpdi.php');
  
  
      $fullPathToFile = "../assets/files/".$arquivo;
      $pdf = new FPDI();
      $pdf-&gt;AddPage(); 
  
      $pdf-&gt;setSourceFile($fullPathToFile); 
      $tplIdx = $this-&gt;pdf-&gt;importPage(1); 
      $this-&gt;pdf-&gt;useTemplate($tplIdx, 0, 0, 0, 0, true); 
  
      $this-&gt;pdf-&gt;SetFont('Arial', '', '13'); 
      $this-&gt;pdf-&gt;SetTextColor(0,0,0);
      $this-&gt;pdf-&gt;SetXY(20, 20);
      $this-&gt;pdf-&gt;Write(0, 'my text');
      $this-&gt;pdf-&gt;Output('gift_coupon_generated.pdf', 'D');
  </code></pre>
  
  <p>but this is returning following error:</p>
  
  <blockquote>
    <p>Fatal error: Class 'setasign\Fpdi\FpdfTpl' not found in
    /home/mysite/public_html/painel/pdf/fpdi/Fpdi.php on line 25</p>
  </blockquote>