【问题标题】:How to convert svg data to image/image base64 using java script [duplicate]如何使用java脚本将svg数据转换为图像/图像base64 [重复]
【发布时间】:2013-06-13 19:08:06
【问题描述】:

我已经使用 Extjs 4.1 为用户提供了打印屏幕的选项来完成应用程序。在所有浏览器中工作正常,没有蚂蚁问题。但在 IE9 中,除了 graph(Svg) 一切都在打印。 谁能告诉我如何在 IE9 中打印图表。或如何将 svg 数据转换为图像 base64? 非常感谢。谢谢

代码在这里

var metricsNumberId = document.getElementById('metricsNumberId');
newWin= window.open();
newWin.document.write('<img src="'+metricsNumberId.innerHTML+'" width="400" height="400""/>');// This one way i have tried is not worked
newWin.document.write('+metricsNumberId.innerHTML+');// This another way i have tried is not worked
newWin.document.close();
newWin.focus();
newWin.print();
newWin.close();
newWin='';

【问题讨论】:

    标签: javascript extjs svg internet-explorer-9 extjs4.1


    【解决方案1】:

    我使用 RaphaelJS 并使用 https://github.com/wout/raphael-svg-importhttps://github.com/crccheck/raphael-svg-import-classic 在 SVG 中加载。之后,您可以使用http://www.phpepe.com/2012/07/export-raphael-graphic-to-image.html 将其导出。看看那个。在我的情况下,我需要向用户呈现视觉表示和按钮来编辑/移动图像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-06
      • 2012-05-12
      相关资源
      最近更新 更多