Looking for a way to convert HTML into an image within an Ionic 4 application. I attempted to use html2canvas
, however, it was unsuccessful and displayed the following message in the console:
https://i.sstatic.net/4b4Sm.png
Below is the code snippet I used:
var element = document.getElementById('capture');
html2canvas(element).then(canvas => {
var imgData = canvas.toDataURL("image/png");
this.socialSharing.share(null, null, imgData);
});