title: export the current web page to pdf
body: <p>I want to export my current web page to pdf.In image green and blue color are the web page content and button in red color.when I click pdf button current page will get download as pdf.now I loaded sample text 'sample' in load_html.This text will converted into pdf.I want to load the whole page instead of sample text.</p>
  
  <p><a href="https://i.stack.imgur.com/gNXwf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gNXwf.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;?php
  
  require_once("dompdf_config.inc.php");
  
  $dompdf = new DOMPDF();
  $dompdf-&gt;load_html("&lt;p&gt;sample&lt;/p&gt;");
  $dompdf-&gt;set_paper('a4', 'portrait');
  $dompdf-&gt;render();
  
  $dompdf-&gt;stream("dompdf_out.pdf"); //for downloading automatically
  ?&gt;
  </code></pre>