I have an image and some text ('p' tags) inside an html tag. Using html2canvas I can convert that html element to image. But When i use an image from server , it say Access control allow origin request blocked error. I also added allowTaint:true, useCORS:true , but nothing changed. Is there any solution for this? Or any other method ?
Here is my code
component.ts
html2canvas(document.getElementById('invoice-panel'),{allowTaint:true, useCORS:true}).then(canvas => {
var imgData = canvas.toDataURL("image/png");
});
html
<ion-avatar id="invoice-panel">
<img [src]="chosenPicture" id="custom-image"/>
<p *ngFor="let field of arrTextFields" absolute-drag class="newText"><b>{{field.text}}</b></p>
</ion-avatar>