Javascript object scope - image dataurls into pdfMake
问题 Trying to dynamically create a pdf using pdfMake from JSON data and the report runs fine except for my images. I have tried using named keys into an object as well as pushing into an array, and even directly into the docDefinition and it appears that they contain the data on console.log but always come back undefined. The only time it actually works if I directly assign it outside of the each ( //imageData["image0"] = testDataURL; ) but this doesn't work for me as I need to get the dataurl of