title: FPDF insert text
body: <p>I have a html form which sends the answers onto a pdf document. Everything is working fine but I would like the questions to be on the pdf document as well.</p>
  
  <p>currently it looks like this on the pdf:</p>
  
  <pre><code>Jurgen
  Yes
  No
  4
  No
  </code></pre>
  
  <p>I would like it to be:</p>
  
  <pre><code>Name: Jurgen
  Do you own a vehicle? Yes
  etc
  </code></pre>
  
  <p>(SOLVED)
  my current code for the fpdf file:</p>
  
  <pre><code>&lt;?php
  
  class PDF extends FPDF
  {
  // Page header
  function Header()
  {
      // Logo
      $this-&gt;Image('images/logo.png', 10, 6, 30);
  
      $this-&gt;SetFont('Arial', 'B', 15);
  
      $this-&gt;Cell(50);
  
  
      $this-&gt;Cell(90, 10, 'Document Title', 'C');
      // Line break
      $this-&gt;Ln(20);
   }
  
   // Page footer
   function Footer()
   {
  
      $this-&gt;SetY(-15);
  
      $this-&gt;SetFont('Arial', 'I', 8);
  
      $this-&gt;Cell(0, 10, 'Page ' . $this-&gt;PageNo() . '/{nb}', 0, 0, 'C');
   }
   }
  ?&gt;
  &lt;?php
  //set the question values
  $questions = array(
             'name' =&gt; "Name: ",
             'date' =&gt; "Date: ",
             'first' =&gt; "First Day of Leave: ",
             'last' =&gt; "Last Day of Leave: ",
             'days' =&gt; "Number of Days Taken: ",
             'email' =&gt; "Managers Email: ",
             'sig' =&gt; "Signed: ",
  
           );
  //set the question answers
  $date = $_POST['date'];
  $first = $_POST['first'];
  $last = $_POST['last'];
  $days = $_POST['days'];
  $email = $_POST['email'];
  $sig = $_POST['sig'];
  $name = $_POST['name'];
  //set the question names
  $questionName = $questions['name'];
  $questionDate = $questions['date'];
  $questionFirst = $questions['first'];
  $questionLast = $questions['last'];
  $questionDays = $questions['days'];
  $questionEmail = $questions['email'];
  $questionSig = $questions['sig'];
  //Create the PDF
  
  require('fpdf.php');
  
  $pdf = new FPDF();
  $pdf-&gt;AddPage();
  
  $pdf-&gt;SetFont('Arial','B',16);
  //insert questions and answers
  $pdf-&gt;MultiCell(150,10,sprintf("%s %s", $questionDate, $date));
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(150,10,sprintf("%s %s", $questionName, $name));
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(150,10,sprintf("%s %s", $questionFirst, $first));
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(150,10,sprintf("%s %s", $questionLast, $last));
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(150,10,sprintf("%s %s", $questionDays, $days));
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(150,10,sprintf("%s %s", $questionEmail, $email));
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(50,10,sprintf("%s %s", $questionSig, $sig));
  //display pdf
  $pdf-&gt;Output(); 
  </code></pre>
  
  <p>I am still learning about FPDF since their documentation isn't the best. If I have made some mistakes please let me know. Thank you</p>