Try this with the playground: http://bpampuch.github.io/pdfmake/playground.html
var text = {text: "This is a test"};
var text2 = {text: "This is also a test"};
var dd = {content: [text, text, text2, text2]};
Notice that the second instance of each text node are not present in the document's rendering.
Same issue here. It makes dynamic creation more complicated.
I noticed that pdfmake alters the variables it gets when calculating things. Maybe this causes it not to work?
If you always create a copy of an object, does that work?
I have the same problem.
@bpampuch do you have an idea for a fix or a workaround?
Pass myArray.slice(0) or JSON.parse(JSON.stringify(myObject))
Most helpful comment
Pass myArray.slice(0) or JSON.parse(JSON.stringify(myObject))