Skip to content
Advertisement

How to show the full SVG using Fabricjs?

First time user of FabricJs and I’m trying to load these SVG files using FabricJS as shown in their examples

JavaScript
JavaScript

If you run the code snippet you will see that only the top part of the image is loaded instead of the entire SVG. I tried doing this with the other method where I create a new Image() and then use new Fabric.Image(img.. with same results?

My question is how do I show the entire image inside the resizer? Is this a bug in FabricJS or there is something I’m doing wrong.

I’ve tried it with dozens of different SVG and it’s always the case.

Advertisement

Answer

JavaScript
JavaScript

You need to use loadSVGFromURL

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement