diff --git a/index.d.ts b/index.d.ts index ab0684d..fcc0333 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -declare module 'pdfkit-table' +declare module 'pdfkit-table' { import PDFDocument from 'pdfkit'; @@ -96,4 +96,4 @@ declare module 'pdfkit-table' // export = PDFDocumentWithTables; export default PDFDocumentWithTables; -} \ No newline at end of file +} diff --git a/index.js b/index.js index 6344638..2fb5bfa 100644 --- a/index.js +++ b/index.js @@ -657,7 +657,8 @@ class PDFDocumentWithTables extends PDFDocument { // For safety, consider 3 rows margin instead of just one // if (startY + 2 * rowHeight < maxY) startY = rowBottomY + columnSpacing + rowDistance; // 0.5 is spacing rows // else this.emitter.emit('addPage'); //this.addPage(); - if(options.useSafelyMarginBottom && this.y + safelyMarginBottom + rowHeight >= maxY && !lockAddPage) onFirePageAdded(); // this.emitter.emit('addPage'); //this.addPage(); + //console.log("startY="+startY+", rowBottomY="+rowBottomY+", this.y="+this.y ) + if(options.useSafelyMarginBottom && rowBottomY + safelyMarginBottom + rowHeight >= maxY && !lockAddPage) onFirePageAdded(); // this.emitter.emit('addPage'); //this.addPage(); // calc position startY = rowBottomY + columnSpacing + rowDistance; // 0.5 is spacing rows diff --git a/package.json b/package.json index 9a9438f..7878bf2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfkit-table", - "version": "0.1.98", + "version": "0.1.101", "description": "PdfKit Table. Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) ", "main": "index.js", "types": "index.d.ts",