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'
}