title: Why lines/images draw only on last page of pdf using dompdf in php
body: <p>I am trying to draw line/image on every page of pdf using dompdf but it starts from second page, why this is so ? anyone has any idea ?<br/>
  Here is my code</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();
  $canvas-&gt;image($header_image1,'jpg',0, 0, 595, 100);
  $canvas-&gt;line(0,100,595,100,array(0,0,0),1);
  $canvas-&gt;close_object();
  $canvas-&gt;add_object($header, "all");
  
  //For Footer
  $footer = $canvas-&gt;open_object();
  $canvas-&gt;line(0,740,650,740,array(0,0,0),1);
  $canvas-&gt;image($footer_image1,'jpg',0, 742, 595, 100);
  $canvas-&gt;close_object();
  $canvas-&gt;add_object($footer, "all");
  
  $output = $dompdf-&gt;output();
  </code></pre>
  
  <p>this code draw line/image on pdf but it only display on last page.<br/>
  I have two pages in pdf and my line/images are drawn on second page not on first page.<br/></p>
  
  <p>Please suggest any solution.</p>