字符串与jspdf-autotable和下溢换行符重叠在下一列上 [英] String overlaps next column with jspdf-autotable and overflow linebreak

查看:270
本文介绍了字符串与jspdf-autotable和下溢换行符重叠在下一列上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有选项overflow: 'linebreak'的jspdf-autoTable创建pdf.问题在于某些长文本与下一列重叠.例如,如果我的文字是"Hai hello welcome",它将打印为"Hai hello wel",其余的"come"将重叠在下一列上.如何在不重叠下一行的情况下使用换行符?

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?

注意:在我更改drawCell method中的文本之前,换行符可以正常工作.

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

我也有这种奇怪的行为:

I get this weird behavior as well:

我发送的邮件:

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

在我的drawCell方法内部:

["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?

推荐答案

预计该字符串将变成一个数组. jspdf库将在新行上打印数组中的每个字符串.如果要使用钩子更改字符串,请使用didParseCell.

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.

这篇关于字符串与jspdf-autotable和下溢换行符重叠在下一列上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆