title: HTML to PDF vs. Programmatically creating PDF via PHP
body: <p>I have a PHP application that needs to generate some PDF invoices and PDF timesheets with nice headers/footers.  Some Stackoverflow users recommend using TCPDF to create the PDF documents.  In my research, I discovered two approaches to generating PDFs:</p>
  
  <p>1) Programmatically formatting the PDF like so:</p>
  
  <pre><code>    $tcpdf-&gt;SetFillColor(255, 0, 0);
      $tcpdf-&gt;SetTextColor(255);
      $tcpdf-&gt;SetDrawColor(128, 0, 0);
      $tcpdf-&gt;SetLineWidth(0.3);
      $tcpdf-&gt;SetFont('', 'B');
  </code></pre>
  
  <p>2) Converting HTML to PDF</p>
  
  <p>How do I decide which I approach I should use? </p>