admin管理员组文章数量:1426123
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. 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();
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. 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();
Share
Improve this question
asked Jan 5, 2017 at 20:29
Honchar DenysHonchar Denys
1,5184 gold badges29 silver badges58 bronze badges
1 Answer
Reset to default 5Strange, but with setup
pageSize: {
width: 630,
height: 891
}
It's working. This is lib bug, refer to Issues of Repo.
本文标签: javascriptpdfmake get wrong page position sizesStack Overflow
版权声明:本文标题:javascript - pdfmake get wrong page position sizes - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745380018a2656116.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论