Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not see the plot in browser using the demo code #89

Open
honghh2018 opened this issue Nov 5, 2022 · 0 comments
Open

Can not see the plot in browser using the demo code #89

honghh2018 opened this issue Nov 5, 2022 · 0 comments

Comments

@honghh2018
Copy link

Hi developer,
when i use the below code to test the canvas2pdf.js , it show me the blank in web not the red rect.

<script src="/api/static/web/js/canvas2svg.js"></script>
  //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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant