博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HTML5 & how to download SVG in js
阅读量:4447 次
发布时间:2019-06-07

本文共 857 字,大约阅读时间需要 2 分钟。

HTML5 & how to download SVG in js

how to download SVG in js

blob 7 URL

740516-20190312173526548-650306488.png

auto download

740516-20190312173613362-1922761273.png


Content-Disposition: attachment; filename=yourfile.svg

// This example was created using Protovis & jQuery// Base64 provided by http://www.webtoolkit.info/javascript-base64.html// Modern web browsers have a builtin function to this as well 'btoa'function encode_as_img_and_link(){ // Add some critical information $("svg").attr({ version: '1.1' , xmlns:"http://www.w3.org/2000/svg"}); var svg = $("#chart-canvas").html(); var b64 = Base64.encode(svg); // or use btoa if supported // Works in recent Webkit(Chrome) $("body").append($("file.svg")); // Works in Firefox 3.6 and Webit and possibly any browser which supports the data-uri $("body").append($("Download"));}


canvas.toDataURL & svg

不能使用SVG图像元素作为drawImage方法的源的原因很简单,但很痛苦

转载于:https://www.cnblogs.com/xgqfrms/p/10518203.html

你可能感兴趣的文章
(十一)tina | openwrt关闭调试串口(DEBUG UART)
查看>>
Android中获取TextView行数
查看>>
AngularJS 学习笔记值post传值
查看>>
maven+springMVC+mybatis+junit详细搭建过程
查看>>
iframe详细用法
查看>>
angularjs 使用angular-sortable-view实现拖拽效果(包括拖动完成后的方法使用)
查看>>
2015生命之旅---南京、南通、上海之行
查看>>
高精度练习之乘法(codevs_3117)
查看>>
小Z爱划水
查看>>
javascript中click和onclick的区别
查看>>
小程序BindTap快速连续点击页面跳转多次
查看>>
什么是架构?有几人说的清楚
查看>>
护士排班06
查看>>
大道至简:软件实践者的思想读后感
查看>>
Kiss MySQL goodbye for development and say hello to HSQLDB
查看>>
Python web多sitemap创建更新解决方案
查看>>
javase基础10
查看>>
Qt Font
查看>>
UILabel设置富文本格式显示
查看>>
[洛谷P3379]【模板】最近公共祖先(LCA)
查看>>