Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pdfmake get wrong page position sizes

Tags:

I am using it on the client side and my pdf file will contain only images. No matter how many i am adding, first image got opposite width with height. While from second and farther everything looks ok. enter image description here And config that i am using is:

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();
like image 898
Honchar Denys Avatar asked Jan 05 '17 20:01

Honchar Denys


1 Answers

Strange, but with setup

pageSize: {
    width: 630,
    height: 891
}

It's working. This is lib bug, refer to Issues of Repo.

like image 79
Honchar Denys Avatar answered Oct 11 '22 15:10

Honchar Denys