At first I thought it is working fine but after a couple of testing, the data became large enough that it won't fit to one page. I researched some questions but it didn't help me enough
so here's my code
html2canvas(document.getElementById(id)).then(function (canvas) {
document.body.appendChild(canvas);
var data = canvas.toDataURL();
var height = canvas.height;
canvas.remove();
var docDefinition = {
content: [{
image: data,
width: 500,
}]
};
pdfMake.createPdf(docDefinition).download(id+".pdf", function() {
$scope.balanceSheet = false;
$scope.mainPage = true;
});
});
I have at least 90 rows here but the image was cut at 46
any idea how to split it? I've already tried raising the height but it just fit the whole 90 rows into one page.
The page break showed because I added
content: [{
image: data,
width: 500,
pageBreak: 'after',
}]
Here's a sample how to split it here but I can't read it because it is not angular :( can anyone explain it or convert it?