【发布时间】:2015-08-02 23:33:40
【问题描述】:
我使用 Raphael 生成了一个图表。现在,当我尝试使用以下代码打印图表时:
var data = document.getElementById("Graph").innerHTML;
var mywindow = window.open('', '_blank', 'height=400,width=600');
mywindow.document.write('<html><head><title></title></head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10
mywindow.print();
mywindow.close();
return true;
window.print();
该图表与所有浏览器中的打印对话框一起显示在一个新窗口中。 该图表在 IE>=10 和 chrome 中打印得非常好,但在 IE9 的情况下,仅打印文本而不是完整的图表。
到目前为止,我已经尝试将我的图表页面的 Meta 标签设置为
<meta http-equiv="X-UA-Compatible" content="IE=11;edge,9;" />
禁用IE9的保护模式。
将图表另存为 PDF 也仅提供文本输出。
【问题讨论】:
标签: javascript internet-explorer svg raphael