You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m using the React app and I have this code with html2canvas & jsPDF node modules.
Can anyone tell me how can we do this without affecting the actual content?
”bi-diagram-canvas” specifies child element and innerHtml contains div and svg tags
var input = document.getElementById('bi-diagram-canvas');
var w = document.getElementById("bi-diagram-canvas").offsetWidth;
var h = document.getElementById("bi-diagram-canvas").offsetHeight;
var height = h/2
html2canvas(input)
.then((canvas) => {
var imgWidth = 210;
var pageHeight = 295;
var imgHeight = canvas.height * imgWidth / canvas.width;
var heightLeft = imgHeight;
const imgData = canvas.toDataURL('image/png')