how to capture canvas text as image convert to base64 javascript code example Example: javascript todataurl var image = new Image(); image.src = canvas.toDataURL();