title: add image at header & footer on every page of pdf using dompdf
body: <p>I am trying to create pdf file using dompdf. <br/>
  I want to show header and footer images on every page of pdf, but my problem is in html I know that, but it's too large html code so I am googled some other solution like used here <a href="https://github.com/dompdf/dompdf/issues/807" rel="nofollow">https://github.com/dompdf/dompdf/issues/807</a>. <br/>This code is fine for textual header and footer but problem at adding image I tried my best for it but no use and getting the error like "Call to undefined method CPDF_Adapter::page_script() in filepathname.php".<br/>
  Here is my code of generating pdf <br/></p>
  
  <pre><code>$dompdf = new DOMPDF();
  $dompdf-&gt;load_html($message2);
  $dompdf-&gt;set_paper('a4','portrait');
  $dompdf-&gt;render();
  
  $canvas = $dompdf-&gt;get_canvas();
  
  //For Header
  $header = $canvas-&gt;open_object();
  $font = Font_Metrics::get_font("helvetica", "bold");
  $date = date("Y-m-d H:i:s");
  $canvas-&gt;page_text(35, 25, "HiveDesk Screenshot Report", $font, 8, array(0, 0, 0));
  $canvas-&gt;page_text(490, 25, "hivedesk.com", $font, 8, array(0, 0, 0));
  $canvas-&gt;close_object();
  $canvas-&gt;add_object($header, "all");
  
  //For Footer
  $footer = $canvas-&gt;open_object();
  $font = Font_Metrics::get_font("helvetica", "bold");
  $date = date("Y-m-d H:i:s");
  $canvas-&gt;page_text(250, 800, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font, 8, array(0, 0, 0));
  
  $canvas-&gt;page_script('$image = '.$header_image1.';
                        $pdf-&gt;image($image, 400, 25, 100, 25);
                      ');
  
  $canvas-&gt;close_object();
  $canvas-&gt;add_object($footer, "all");
  
  $output = $dompdf-&gt;output();
  $filename ="pdf/".time().".pdf";
  file_put_contents("$filename",$output);
  </code></pre>
  
  <p><br/>
  <b>Note:</b> $message2 contains all my html content. <br/>
  Can anyone please give me a solution? <br/>Thanks in advance. </p>