Saving a DIV as an Image <p>I have:</p> <pre><code>echo" &lt;div id=IwantToSaveThisWholeDivAsAnImage)&gt; &lt;div id=OneOfMultipleDivs&gt; &lt;table&gt;multiple tables rendered here &lt;/table&gt; &lt;/div&gt; &lt;/div&gt;"; </code></pre> <p>I have tried (one of many):</p> <pre><code>$html_code = " &lt;html&gt; &lt;head&gt; &lt;title&gt;Image&lt;/title&gt; &lt;style&gt; body { font-family:verdana; font-size:11px; color:black } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; my tables here &lt;/body&gt; &lt;/html&gt;"; $img = imagecreate("300", "600"); $c = imagecolorallocate($img, 0, 0, 0); $c2 = imagecolorallocate($img, 255, 255, 255); imageline($img,0,0,300,600,$c); imageline($img,300,0,0,600,$c2); $white = imagecolorallocate($img, 255, 255, 255); imagettftext($img, 9, 0, 1, 1, $white, "arial.tff", '$html_code'); header("Content-type: image/jpeg"); imagejpeg($img); </code></pre> <p>I'm not allowed to use outside libaries. Read that it can be done with GD, but I have been unsuccessful thus far. Any ideas and help would be greatly appreciated! UB</p>