Pdfmake.js and json as content

1k Views Asked by At

When I try to put an json as content it does render as a whole string. So I see the json syntax in the pdf, instead of the formated. What did I miss?

var docDefinition = {
content: jsonObj,
styles: {
 header: {
   fontSize: 22,
   bold: true
 },
 anotherStyle: {
   italic: true,
   alignment: 'right'
 }
}
};
1

There are 1 best solutions below

0
On

Ok. Turns out, that the array had pushed strings instead of objects. So code example is working.