I try to add an image to a cell with rowSpan, but it always return "TypeError: Cannot read property 'replace' of undefined", here is the doc definition :
{
table: {
headerRows: 0,
widths: [132, 132, '*'],
body: [
[
{
text: 'Text One',
alignment: 'center',
bold:true,
fillColor:'#efefef'
},
{
text: 'Text Two',
alignment: 'center',
bold:true,
fillColor:'#efefef'
},
{
rowSpan: 4,
text:[
{
image: // a long dataURI string,
alignment: 'center',
width: 120,
margin: [0, 20, 0, 20]
},
{
text: 'This is a long text in a spanned rows',
alignment: 'center',
fontSize: 9
}
]
}
],
['\n \n \n \n \n \n', '\n \n \n \n \n \n', {}],
['Name: ', 'Name: ', {}],
['Date: ', 'Date: ', {}]
]
}
}
Is there anything wrong? Or adding an image to cell with a rowSpan / colSpan is still not supported?
Thanks...
Issue fixed, after I replaced the 'text' node with 'stack' node inside the rowSpan. Here are the final doc definition that works :
{
table: {
headerRows: 0,
widths: [132, 132, '*'],
body: [
[
{
text: 'Text One',
alignment: 'center',
bold:true,
fillColor:'#efefef'
},
{
text: 'Text Two',
alignment: 'center',
bold:true,
fillColor:'#efefef'
},
{
rowSpan: 4,
stack:[
{
image: // a long dataURI string,
alignment: 'center',
width: 120,
margin: [0, 20, 0, 20]
},
{
text: 'This is a long text in a spanned rows',
alignment: 'center',
fontSize: 9
}
]
}
],
['\n \n \n \n \n \n', '\n \n \n \n \n \n', {}],
['Name: ', 'Name: ', {}],
['Date: ', 'Date: ', {}]
]
}
}
Most helpful comment
Issue fixed, after I replaced the 'text' node with 'stack' node inside the rowSpan. Here are the final doc definition that works :