pdfkit-table
Advanced tools
Comparing version 0.1.51 to 0.1.52
36
index.js
@@ -314,3 +314,3 @@ // jshint esversion: 6 | ||
let rowHeight = computeRowHeight(table.headers); | ||
let lastPosition = startX; // x position head | ||
let lastPositionX = startX; // x position head | ||
@@ -341,3 +341,3 @@ // Check to have enough room for header and first rows. default 3 | ||
const rectCell = { | ||
x: lastPosition, | ||
x: lastPositionX, | ||
y: startY - columnSpacing - (rowDistance * 2), | ||
@@ -351,3 +351,3 @@ width: columnSizes[i], | ||
this.text(header, lastPosition, startY, { | ||
this.text(header, lastPositionX, startY, { | ||
width: columnSizes[i] >> 0, | ||
@@ -357,3 +357,3 @@ align: "left", | ||
lastPosition += columnSizes[i] >> 0; | ||
lastPositionX += columnSizes[i] >> 0; | ||
@@ -378,4 +378,4 @@ }); | ||
// background header | ||
const rectRow = { | ||
x: lastPosition, | ||
const rectCell = { | ||
x: lastPositionX, | ||
y: startY - columnSpacing - (rowDistance * 2), | ||
@@ -387,6 +387,6 @@ width: width, | ||
// add background | ||
this.addBackground(rectRow); | ||
this.addBackground(rectCell); | ||
// write | ||
this.text(label, lastPosition + 0, startY, { | ||
this.text(label, lastPositionX, startY, { | ||
width: width, | ||
@@ -396,3 +396,3 @@ align: "left", | ||
lastPosition += width; | ||
lastPositionX += width; | ||
@@ -419,2 +419,4 @@ }); | ||
let lastPositionX; | ||
// Datas | ||
@@ -442,3 +444,3 @@ table.datas.forEach((row, i) => { | ||
let posX = startX; | ||
lastPositionX = startX; | ||
@@ -453,3 +455,3 @@ // Print all cells of the current row | ||
const rectCell = { | ||
x: posX, | ||
x: lastPositionX, | ||
y: startY - columnSpacing - (rowDistance * 2), | ||
@@ -507,7 +509,7 @@ width: width, | ||
this.text(text, posX, startY, { | ||
this.text(text, lastPositionX, startY, { | ||
width: width, | ||
align: "left", | ||
}); | ||
posX += width; | ||
lastPositionX += width; | ||
@@ -560,3 +562,3 @@ // set style | ||
let posX = startX; | ||
lastPositionX = startX; | ||
@@ -567,3 +569,3 @@ row.forEach((cell, index) => { | ||
// x: columnPositions[index], | ||
x: posX, | ||
x: lastPositionX, | ||
y: startY - columnSpacing - (rowDistance * 2), | ||
@@ -584,3 +586,3 @@ width: columnSizes[index], | ||
this.text(cell, posX, startY, { | ||
this.text(cell, lastPositionX, startY, { | ||
width: columnSizes[index], | ||
@@ -590,3 +592,3 @@ align: "left", | ||
posX += columnSizes[index]; | ||
lastPositionX += columnSizes[index]; | ||
@@ -593,0 +595,0 @@ }); |
{ | ||
"name": "pdfkit-table", | ||
"version": "0.1.51", | ||
"version": "0.1.52", | ||
"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", |
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
31777
462