pdfkit-table
Advanced tools
Comparing version 0.1.48 to 0.1.49
21
index.js
@@ -82,3 +82,3 @@ // jshint esversion: 6 | ||
const maxY = this.page.height - (this.page.margins.bottom + 5); | ||
const maxY = this.page.height - (this.page.margins.top + this.page.margins.bottom); | ||
@@ -217,3 +217,3 @@ let startX = options.x || this.x || this.page.margins.left; | ||
let result = 0; | ||
// if row is object, content with property and options | ||
@@ -241,2 +241,4 @@ if( !Array.isArray(row) && typeof row === 'object' && !row.hasOwnProperty('property') ){ | ||
text = String(text).replace('bold:',''); | ||
// calc | ||
@@ -326,13 +328,10 @@ // calc height size of string | ||
let rowHeight = computeRowHeight(table.headers); | ||
let lastPosition = 0; // x position head | ||
// Check to have enough room for header and first rows. default 3 | ||
if (startY + 2 * computeRowHeight(table.headers) > maxY) { | ||
this.addPage(); | ||
} | ||
// if (startY + 2 * rowHeight > maxY) this.addPage(); | ||
let lastPosition = 0; // x position head | ||
if(table.headers && table.headers.length > 0){ | ||
let rowHeight = computeRowHeight(table.headers); | ||
if(typeof table.headers[0] === 'string') { | ||
@@ -476,3 +475,3 @@ | ||
// else this.addPage(); | ||
startY + 2 * rowHeight >= maxY && this.addPage(); | ||
if(startY + 2 * rowHeight >= maxY) this.addPage(); | ||
startY = rowBottomY + columnSpacing + rowDistance; // 0.5 is spacing rows | ||
@@ -591,3 +590,3 @@ | ||
// For safety, consider 3 rows margin instead of just one | ||
// if (startY + 2 * rowHeight < maxY) startY = rowBottomY + columnSpacing + rowDistance; // 0.5 is spacing rows | ||
// if (startY + 3 * rowHeight < maxY) startY = rowBottomY + columnSpacing + rowDistance; // 0.5 is spacing rows | ||
// else this.addPage(); | ||
@@ -594,0 +593,0 @@ if(startY + 2 * rowHeight >= maxY) this.addPage(); |
{ | ||
"name": "pdfkit-table", | ||
"version": "0.1.48", | ||
"version": "0.1.49", | ||
"description": "PdfKit Table. Helps to draw informations in simple tables using pdfkit. #server-side. Generate pdf tables with javascript (PDFKIT plugin) ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -371,2 +371,6 @@ # pdfkit-table | ||
### 0.1.49 | ||
+ Max size age | ||
### 0.1.48 | ||
@@ -373,0 +377,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33284
501
496