Skip to content

Commit da25b2a

Browse files
committed
Add cellInitialize and sample Table.
1 parent f298c33 commit da25b2a

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

jspdf.plugin.cell.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,31 @@
6464
pages += 1;
6565
};
6666

67+
jsPDFAPI.cellInitialize = function () {
68+
maxLn = 0;
69+
lastCellPos = { x: undefined, y: undefined, w: undefined, h: undefined, ln: undefined };
70+
pages = 1;
71+
};
72+
73+
/* sample
74+
75+
var doc = new jsPDF('p', 'pt');
76+
var i, j = 0;
77+
doc.cellInitialize();
78+
for (i = 0; i <= 100; i++ ){
79+
doc.cell(10, 40, 100, 20, 'Cell '+j, i);
80+
j++;
81+
doc.cell(10, 40, 100, 20, 'Cell '+j, i);
82+
j++;
83+
doc.cell(10, 40, 100, 20, 'Cell '+j, i);
84+
j++;
85+
doc.cell(10, 40, 100, 20, 'Cell '+j, i);
86+
j++;
87+
}
88+
doc.save('Test.pdf');
89+
90+
*/
91+
6792
jsPDFAPI.cell = function (x, y, w, h, txt, ln) {
6893
if ((((ln * h) + y + h) / pages) >= this.internal.pageSize.height && pages === 1) {
6994
this.cellAddPage();

0 commit comments

Comments
 (0)