screenshot[html_] := Module[{file, w = 1024,}, file = FileNameJoin[{$TemporaryDirectory, "file.htm"}]; s = OpenWrite[file]; WriteString[s, "
ToString@w <> "px;overflow:auto;padding:2px;\"> " <> html <> "
"]; Close[s]; ImageCrop@ImageCrop@dotNetBrowserScreenshot[file, Width -> w + 4] ]