Hello,
I want to insert images created on the fly using html2canvas in didDrawCell hook, but not work.
Insert any image outside the promise works fine.
Can you help me?
Thanks in advance
didDrawCell: data => {
if (data.section === 'body' && data.column.index === 0 && index === 0) {
var componente = data.cell.raw.children[0];
var opciones = {logging:false};
html2canvas(componente,opciones)
.then(function (miniImagen) {
imgData = miniImagen.toDataURL('image/png');
this.addImage(imgData, 'png', data.cell.x + 2, data.cell.y + 2, 12, 9);
})
}
autoTable hooks are synchronous, You should load all your images before calling doc.autoTable().
Thanks @mmghv
Most helpful comment
autoTable hooks are synchronous, You should load all your images before calling
doc.autoTable().