0👍
Some curly brackets are missing in the code. It will work like in this way:
var docDefinition = {
content: [{
image: url }, {
table: {
headerRows: 1,
widths: [ '*', 'auto', 100, '*' ],
body: [
[ 'First', 'Second', 'Third', 'The last one' ],
[ 'Value 1', 'Value 2', 'Value 3', 'Value 4' ],
[ { text: 'Bold value', bold: true }, 'Val 2', 'Val 3', 'Val 4' ]
]
},
width:500,
}]
};
Source:stackexchange.com