I use it on the client side and my pdf file will only contain images. No matter how much I add, the first image got the opposite width with height. Although from the second onwards everything looks normal.
And the config I use:
var content = [];
for (var j = 0; j < pages.length; j++) {
if(pages[j].dataUrl) content.push({
image: pages[j].dataUrl,
width: 891,
height: 630
});
}
var docDefinition = {
pageSize: {
width: 891,
height: 630
},
pageOrientation: 'landscape',
pageMargins: [ 0, 0, 0, 0 ],
content: content
};
pdfMake.createPdf(docDefinition).open();
source
share