I am currently using PDFMake to create detailed profiles for each person I select in my table.
Check out the sample below:
https://i.sstatic.net/eFLDs.png
For every selection I make, I need to produce a separate document with their information in a PDF using PDFMake, along with their QR Code. I have successfully printed this in my console:
https://i.sstatic.net/WcHKA.png
Here is the code snippet for that:
var docDefinition;
for (var vin = 0; vin < this.selected.length; vin++) {
var nestedArr = new Array(this.selected);
var s = nestedArr[0][vin].LAST_M + "\n" + nestedArr[0][vin].MEMB_N;
console.log(s);
docDefinition = {
pageSize: "A6",
pageMargins: [0, 0, 0, 0],
content: { text: s }
};
}
pdfMake.createPdf(docDefinition).print();
},
However, when it comes to generating the PDFs with their details, only the information of the last selected person is being displayed, not all the people I selected. This can be seen in the image below:
https://i.sstatic.net/iBlcO.png
I believe the issue lies within the docDefinition because it creates a new instance every time I generate a PDF and only captures the data from the last ticked person.
How can I go about solving this problem?