Created
June 20, 2012 21:37
-
-
Save cburgmer/2962400 to your computer and use it in GitHub Desktop.
Minimal example for rasterizeHTML.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>rasterizeHTML.js example</title> | |
<script type="text/javascript" src="lib/htmlparser.js"></script> <!-- Needed for Chrome & Safari to work around buggy XMLSerializer --> | |
<script type="text/javascript" src="lib/cssParser.js"></script> <!-- Needed to embed backgroundImages --> | |
<script type="text/javascript" src="lib/URI.js"></script> <!-- Needed to calculate paths when embedding stuff --> | |
<script type="text/javascript" src="rasterizeHTML.js"></script> | |
</head> | |
<body> | |
<canvas id="canvas" width="400" height="200"></canvas> | |
<script type="text/javascript"> | |
var canvas = document.getElementById("canvas"); | |
rasterizeHTML.drawHTML('Some <span style="color: green">HTML</span> with an image <img src="someimg.png" />', canvas); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment