Jspdf-autotable: autoTableText overflow

Created on 1 Aug 2016  路  3Comments  路  Source: simonbengtsson/jsPDF-AutoTable

Hi,

I'm trying to control the overflow of autoTableText but I can't achieve it.

This is my actual output:
citec-hor1
(check the text at the right border.. should be inside of the blue rect)
And I'm having this

...
doc.setFillColor(0, 255, 255);
doc.rect(cell.x, cell.y, cell.width*2, cell.height*2, 'F');
doc.autoTableText(d.notes[0].note, cell.x + 5, cell.y + cell.height / 2, {
  halign: 'left',
  valign: 'middle',
  overflow: 'linebreak'
});
...

How I should do it?

question

Most helpful comment

autoTableText does only support the valign and halign styles, not overflow. To make the text fit the box I would use the jspdf functions splitTextToSize and getStringUnitWidth.

All 3 comments

autoTableText does only support the valign and halign styles, not overflow. To make the text fit the box I would use the jspdf functions splitTextToSize and getStringUnitWidth.

As you can see on my reaction... <3 thanks

Oops, If any user need this...I solved it using splitTextToSize and passing the array to autoTableText

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoakFlores picture JoakFlores  路  3Comments

tapz picture tapz  路  3Comments

ultra2 picture ultra2  路  6Comments

cplaiu picture cplaiu  路  3Comments

AminBangash picture AminBangash  路  5Comments