title: How to convert a php page in to jpeg file and to download
body: <p>I am trying to convert a web page into jpeg image file. i had used following codes.</p>
  
  <pre><code>&lt;?php    //put your html code here
  $html_code = "
  &lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;My test title&lt;/title&gt;
   &lt;style&gt;
   body {
   font-family:verdana;
   font-size:11px;
   color:black
   }
   &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
   this is the body
  &lt;/body&gt;
  &lt;/html&gt;";
  
  // Create the image
  $img = imagecreate("300", "600");
  imagecolorallocate($img,0,0,0);
  $c = imagecolorallocate($img,70,70,70);
  imageline($img,0,0,300,600,$c);
  imageline($img,300,0,0,600,$c);
  
  $white = imagecolorallocate($img, 255, 255, 255);
  imagettftext($img, 9, 0, 1, 1, $white, "VERDANA.TTF", $html_code);
  
  // Display the image
  header("Content-type: image/jpeg");
  imagejpeg($img);
  
  ?&gt;
  </code></pre>
  
  <p><strong>Question:</strong> Is there any library to convert html page into image ?</p>