title: create image from html
body: <p>i want to create an image from html, i couldn't use painty since it is outdated and no longer working and i want something similar.
  i have already tried to create image using GD library like this</p>
  
  <pre><code>&lt;?php
  $html_code = "&lt;b&gt; this is the body &lt;/b&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,$c2); 
   imageline($img,300,0,0,600,$c2); 
  
  $white = imagecolorallocate($img, 255, 255, 255); 
  imagettftext($img, 9, 0, 1, 1, $white, "arial.ttf", $html_code); 
  
  // Display the image 
  header("Content-type: image/jpeg"); 
  imagejpeg($img);
  </code></pre>
  
  <p>but it doesn't "compile" the html tags and prints them in the image as text.</p>
  
  <p>Best Regards</p>