String overlaps next column with jspdf-autotable and overflow linebreak

做~自己de王妃 提交于 2020-01-04 05:36:14

问题


I'm using jspdf-autoTable with the option overflow: 'linebreak' to create a pdf. The problem is that some long texts are overlapping the next column. For example, if my text is "Hai hello welcome" it will print as "Hai hello wel" with the remaining "come" overlapped on the next column. How can I use linebreak without overlapping the next column?

Note: Linebreak works fine until I'm changing the text in the drawCell method.

I get this weird behavior as well:

What I send in:

Paragraph writing is the foundation of all essay writing whether the form is expository persuasive narrative or creative

Inside my drawCell method:

["Paragraph writing is the foundation of all","essay writing whether the form is expository","persuasive narrative or creative"]

I don't know why it automatically divided the string into an array. Could this be the reason for the overlapping issue?


回答1:


It is expected that the string turns into an array. The jspdf lib will print each string in the array on a new line. If you want to change the string with hooks, use the didParseCell.



来源:https://stackoverflow.com/questions/38887529/string-overlaps-next-column-with-jspdf-autotable-and-overflow-linebreak

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!