How to convert canvas to SVG with embedded image base64 in fabricjs
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have fabricjs canvas with image, which I loaded by fabric.Image.fromURL() method. I need export it to SVG, but I want to export image as embedded source in base64, not as a link. How can I do it? Is it any way to load image as a source not as a link? Example code: Loading image: fabric.Image.fromURL('./assets/people.jpg', function (image) { image.set({ left: 10, top: 30 }); canvas.add(image); }; Exporting to SVG: canvas.toSVG(); In exported SVG I have: <image xlink:href="http://localhost:8383/app/assets/people.png" /> But I want it in