I am trying to take a screenshot by using html2canvas
using ionicframework
. The html2canvas works in every way except those that i have classes with :before
. such as
CSS
.e_amount::before{
content: "$";
}
Before taking the screen shot it looks like this:
After the html2canvas code:
Noticed the Dollar Sign ($) is not aligned with the 10.00.
I have tried including the style in the head it is still not working. What am i missing?
JS
html2canvas(document.getElementById('card'), {
onrendered: function(canvas) {
window.canvas2ImagePlugin.saveImageDataToLibrary(
function(msg){
console.log(msg);
var message = {
text: "QR Generated",
image: "file://"+msg
};
window.socialmessage.send(message);
},
function(err){
console.log(err);
},
canvas
);
}
});
html
<div class="list card" id="card">
<div class="item item-body">
<div class="row" style="margin-bottom: 5px; border-bottom: 1px solid #ddd;">
<style>.e_amount::before{content:'$' !important;}</style>
<div class="col bold">{{"amount" | translate}}</div>
<div class="col e_amount"></div>
</div>
</div>
</div>