I'm using the jsPDF plugin to generate a PDF. In my created method, I get an array, scroll through it, try to write and position dynamically in the PDF, however I have no idea how to do it.
$scope.gerarPdf = function (item) {
var doc = new jsPDF();
for (var i = 0; i < item.length; i++) {
doc.text(item[i].nome, x, y);
doc.text(item[i].validade, x, y);
doc.text(item[i].saldoParcial, x, y);
}
doc.save('teste.pdf');
return doc;
};
Where I have: 'x', 'y', is where I wanted to dynamically define the positioning.