如何解决React js jspdf太长表格中的文字被截断
正如你从图片中看到的,我有一个很长的文本,它在单元格的末尾被剪掉了。
我该如何解决这个问题,有没有人知道如何帮助我?
var doc = new jsPDF({ putOnlyUsedFonts: true,orientation: "landscape" });
var generateData = function(amount) {
var result = [];
let t = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,but also the leap into electronic typesetting1,remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,but also the leap into electronic typesetting2,but also the leap into electronic typesetting3,but also the leap into electronic typesetting4,but also the leap into electronic typesetting5,but also the leap into electronic typesetting6,and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
var splitTitle = doc.splitTextToSize(t,180);
var data = {
coin: "100",game_group: "GameGroup",game_name: "XPTO2",game_version: "25",machine: splitTitle,vlt: "0"
};
for (var i = 0; i < amount; i += 1) {
data.id = (i + 1).toString();
result.push(Object.assign({},data));
}
return result;
};
function createHeaders(keys) {
var result = [];
for (var i = 0; i < keys.length; i += 1) {
result.push({
id: keys[i],name: keys[i],prompt: keys[i],width: 65,align: "center",padding: 0
});
}
return result;
}
var headers = createHeaders([
"game_group","machine",]);
doc.table(1,1,generateData(100),headers,{ autoSize: true });
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。