title: Generate a PDF receipt with PHP
body: <p>So I'm building an online store, and I want to send the customer an order confirmation with receipt included. I've searched a bit, but I haven't managed to create anything.</p>
  
  <p>Here's something I found, and tried using, but didn't manage to create anything. </p>
  
  <pre><code>&lt;?php
   $pdf = pdf_new();
   pdf_open_file($pdf, "kuitti.pdf");
   pdf_begin_page($pdf, 595, 842);
   $arial = pdf_findfont($pdf, "Arial", "host", 1); pdf_setfont($pdf, $arial, 10);
   pdf_show_xy($pdf, $_REQUEST['cartContent'] , 50, 750);
   pdf_end_page($pdf);
   pdf_close($pdf);
  ?&gt;
  </code></pre>
  
  <p>So an ajax call will pass the cartContent to the script, and it should print it to a pdf. But no, is it even possible? </p>