Skip to content

Instantly share code, notes, and snippets.

@brendandahl
Created September 18, 2012 17:30
Show Gist options
  • Save brendandahl/3744488 to your computer and use it in GitHub Desktop.
Save brendandahl/3744488 to your computer and use it in GitHub Desktop.
mozPrintCallback
<!DOCTYPE html>
<html>
<head>
<title>mozPrintCallback</title>
</head>
<body>
<canvas id="canvas" width="200" height="200"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('canvas');
canvas.mozPrintCallback = function(printState) {
var ctx = printState.context;
ctx.fillText('Hi there.', 50, 50);
printState.done();
};
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment