3

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"
            }
          ]
        ]
      }
    }
  ]
}
SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
L. Kvri
  • 1,456
  • 4
  • 23
  • 41

1 Answers1

4

Got Alternative solution to draw line without using canvas:

          {
                table : {
                    headerRows : 1,
                    widths: [930],
                    body : [
                            [''],
                            ['']
                            ]
                },
                layout : 'headerLineOnly'
          }
J4GD33P 51NGH
  • 630
  • 1
  • 8
  • 24