canvas2svg
canvas2svg copied to clipboard
Can not see the plot in browser using the demo code
Hi developer, when i use the below code to test the canvas2pdf.js , it show me the blank in web not the red rect.
//make a mock canvas context using canvas2svg. We use a C2S namespace for less typing:
var ctx = new C2S(500,500); //width, height of your desired svg file //do your normal canvas stuff: ctx.fillStyle="red"; ctx.fillRect(100,100,100,100); //ok lets serialize to SVG: var myRectangle = ctx.getSerializedSvg(true); //true here will replace any named entities with numbered ones. //Standalone SVG doesn't support most named entities.
Is anything wrong for this code?
Best, hanhuihong