title: Simple way to convert htm to pdf on button click?
body: <p>I've created a htm file with php code inside, that's very huge file i will summarize here.</p>
  
  <pre><code>&lt;?php
  //database connection and query and storing data in php variables 
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;&lt;?php echo "firstname ". $var1 ?&gt;&lt;/p&gt;
  &lt;p&gt;&lt;?php echo "firstname ". $var2 ?&gt;&lt;/p&gt;
  &lt;p&gt;&lt;?php echo "firstname ". $var3 ?&gt;&lt;/p&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm getting output .htm file with echoing php variables successfully, now end of html file I want to create a button for save as pdf option and convert the entire document to pdf for user using php, I gone through tcpdf file but didn't find any useful source to add php code within $html.</p>