I would like to propose 2 new options windowWidth and windowHeight. This would allow a dom element to be rendered at a certain width and or height. When using css media queries we could force the image to be rendered at a certain browser width. Below is an example of how I see it working.
Is there a way to do this now?
var node = document.getElementById('receipt_wrapper');
domtoimage.toPng(node,{windowWidth:'280px',windowHeight:'auto'})
.then(function (dataUrl) {
var img = new Image();
img.src = dataUrl;
document.body.appendChild(img);
})
.catch(function (error) {
console.error('oops, something went wrong!', error);
});
I would like to propose 2 new options windowWidth and windowHeight. This would allow a dom element to be rendered at a certain width and or height. When using css media queries we could force the image to be rendered at a certain browser width. Below is an example of how I see it working.
Is there a way to do this now?