2016-11-18 173 views
0

你好,我正试图用html2canvas的帮助打印与一些图标的笔记列表的div。 enter image description herehtml2canvas问题与图标

看到上面是我的输入图像。 enter image description here

但我得到这个输出。请帮助我,如果任何一个

.icon-circle:before { 
 
     content: "\e941"; 
 
    }
<div style="position: relative; border-bottom: 1px solid #cecece; display: table-cell; vertical-align: middle; width: 85px; padding:5px 0;"> 
 
    <i class="icon-circle" style="color:"blue"> 
 
    <span style="color: white;font-size: 18px;position: absolute; top: 22px;left: 13px;"> T 
 
    </span> 
 
    </i> 
 
</div>

有任何解决方案

+0

我觉得你的问题是在图标上的绝对位置。为什么要绝对定位尝试相对定位以避免转换时出现计算问题。 –

+0

谢谢@MarcosPérezGude 是的,这是因为位置,但我怎么能得到该图标上方的图标,而没有给它的位置我也绝对也试过,但它给了我同样的结果如上。 –

+0

那么它的问题将html2canvas 0.5.0-alpha1。我已经在github上报道过,你可以在github上看到我的小提琴和其他细节https://github.com/niklasvh/html2canvas/issues/1001 –

回答

0

终于在html2canvas的新版本1.1,我得到了解决#1001

这里是fiddle

window.takeScreenShot = function() { 
    html2canvas(document.getElementById("target"), { 
     width:320, 
     height:220 
    }).then(function (canvas) { 
     document.body.appendChild(canvas); 
    }); 
}