如何将图像作为徽标传递到pdf模板而不在模板部分中设置

I have created a text area where you can input html portion and upon clicking submit button it will convert the html code output to pdf.

I want to pass a logo on the header of the pdf without setting it in the template portion. I have tried everything but it doesn't work.

Here is my code:

<?php

  include('New_folder/mpdf.php');
  $logo="<img src='images/sam.jpg'>";

  $msg  = $_POST['message'];

  $html .="

  <html> 
    <head>

    </head>

    <body>
      <div class='image'>    
        <img src=".$logo." style='width: 316px;'>    
      </div>

    </body>
  </html>
  ";

  $mpdf=new mPDF();
  $mpdf->WriteHTML($msg);
  $mpdf->SetDisplayMode('fullpage');

  $mpdf->Output();

  ?>    
?>

mpdf guide

   Image($filename, $x, $y, $width, $height, $ext, $href_link, $paint=true, $constrain=true, $is_watermark=false)

    <?php

    $mpdf->Image('files/images/frontcover.jpg',0,0,210,297,'jpg','',true, false);

// the last "false" allows a full page picture