Pdfmake does not match page position size

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. enter image description here 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();
+4
source share
1 answer

Strange, but with the setting

pageSize: {
    width: 630,
    height: 891
}

He works. This is a lib error, see Repo Issues.

+2
source

Source: https://habr.com/ru/post/1665925/


All Articles