如何在JavaScript中生成来自2d数组的pdf,如下所述 样本数组 var datasets = [[1.0,199.6],[2.0,205.05],[3.0,283.6],[4.0,220.15],[5.0,313.05]];
答案 0 :(得分:0)
Here's a client side solution仅用于使用JavaScript生成PDF文件。
代码:
var data = [[1.0,199.6],[2.0,205.05],[3.0,283.6],[4.0,220.15],[5.0,313.05]];
var doc = new jsPDF();
doc.setFontSize(40);
doc.text(35, 25, data.map(function(e){ return e.join("\t"); }).join("\n"));