html - 保存包含相对路径的 SVG
问题描述
我有以下内联代码:
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
....
<svg width="1152" height="648" viewBox="0 0 1152 648" aria-describedby="title" id="svg">
<title id="title">Supporter Plan</title>
<image xlink:href="../images/Image1.png" x="0" y="0" width="100%" height="100%"></image>
<image xlink:href="../images/Image2.png" x="0" y="0" width="100%" height="100%"></image>
<foreignobject x="190" y="177" width="811" height="373">
<body xmlns="http://www.w3.org/1999/xhtml">
<iframe style="border: none" src="../fo.html" scrolling="no" width="100%" height="100%">
</iframe>
</body>
</foreignobject>
</svg>
...
</body>
</html>
我想将创建的图像保存为文件。但是,如果我通过创建带有所需标题的 svg 内容的链接来保存它var url = "data:image/svg+xml;charset=utf-8,"+encodeURIComponent(source);
,source
则创建的文件不会评估图像或 iframe。
我该如何解决这个问题?
解决方案
推荐阅读
- amazon-web-services - errorType”:AWS Lambda 函数的“Runtime.HandlerNotFound”
- mongodb - 有没有办法在一个查询MongoDB中跳过不同的查找过滤器输出
- apache - 让我们用 Docker 加密证书
- ruby-on-rails - Rails:对来自循环数组的值
- javascript - 除非事件处理程序完成执行,否则反应会阻止重新渲染吗?
- c++ - c ++如何将右值引用传递给另一个函数
- python - 从python获取符号链接路径
- javascript - format.js 中的 Rails 5 未知格式错误
- php - 按一个列值对行进行分组,对另一列求和并计算出现次数
- javascript - 尝试编写 Fluid App 用户脚本以禁用概念侧边栏自动弹出行为