admin管理员组文章数量:1415476
I would appreciate if someone explain me, which one can be that case, when the canvas declaration with type "line" emit a page break, in the pdf. I unable to figured out what is the cause of it. If I removed all cancas, no page break in the downloaded pdf.
Thank you in advance.
Here is the code which I used:
var dd = {
content: [{
"canvas": [{
"lineColor": "gray",
"type": "line",
"x1": 0,
"y1": 0,
"x2": 515,
"y2": 0,
"lineWidth": 1
}]
},
{
"margin": [5, 10, 0, 5],
"layout": "noBorders",
"fontSize": 10,
"table": {
"heights": 18,
"widths": [110, "*", "*", "*"],
"body": [
[{
"text": "Text 1",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 1 value"
}
],
[{
"text": "Text 2",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 2 value"
}
]
]
}
},
{
"canvas": [{
"lineColor": "gray",
"type": "line",
"x1": 0,
"y1": 0,
"x2": 515,
"y2": 0,
"lineWidth": 1
}]
},
{
"margin": [5, 10, 0, 5],
"layout": "noBorders",
"fontSize": 10,
"table": {
"heights": 18,
"widths": [110, "*", "*", "*"],
"body": [
[{
"text": "Text 1",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 1 value"
}
],
[{
"text": "Text 2",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 2 value"
}
]
]
}
}
]
}
I would appreciate if someone explain me, which one can be that case, when the canvas declaration with type "line" emit a page break, in the pdf. I unable to figured out what is the cause of it. If I removed all cancas, no page break in the downloaded pdf.
Thank you in advance.
Here is the code which I used:
var dd = {
content: [{
"canvas": [{
"lineColor": "gray",
"type": "line",
"x1": 0,
"y1": 0,
"x2": 515,
"y2": 0,
"lineWidth": 1
}]
},
{
"margin": [5, 10, 0, 5],
"layout": "noBorders",
"fontSize": 10,
"table": {
"heights": 18,
"widths": [110, "*", "*", "*"],
"body": [
[{
"text": "Text 1",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 1 value"
}
],
[{
"text": "Text 2",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 2 value"
}
]
]
}
},
{
"canvas": [{
"lineColor": "gray",
"type": "line",
"x1": 0,
"y1": 0,
"x2": 515,
"y2": 0,
"lineWidth": 1
}]
},
{
"margin": [5, 10, 0, 5],
"layout": "noBorders",
"fontSize": 10,
"table": {
"heights": 18,
"widths": [110, "*", "*", "*"],
"body": [
[{
"text": "Text 1",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 1 value"
}
],
[{
"text": "Text 2",
"margin": [10, 0, 0, 0],
"bold": true
},
{
"text": "Text 2 value"
}
]
]
}
}
]
}
Share
Improve this question
edited Aug 27, 2018 at 20:30
SiddAjmera
39.5k6 gold badges76 silver badges113 bronze badges
asked Aug 27, 2018 at 20:14
L. KvriL. Kvri
1,7334 gold badges26 silver badges46 bronze badges
2
- One more thing which can be help, the line in the pdf shifted right, but in the preview it is not shifted. – L. Kvri Commented Aug 27, 2018 at 20:17
- did you got solution to your problem ? @Laszlo – J4GD33P 51NGH Commented Sep 21, 2020 at 7:39
1 Answer
Reset to default 4Got Alternative solution to draw line without using canvas:
{
table : {
headerRows : 1,
widths: [930],
body : [
[''],
['']
]
},
layout : 'headerLineOnly'
}
本文标签: javascriptpdfMake page break effect when used canvas with typequotlinequotStack Overflow
版权声明:本文标题:javascript - pdfMake page break effect when used canvas with type="line" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745184562a2646622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论