@flowaccount/pdfmake 1.0.7-staging.0 → 1.0.7-staging.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowaccount/pdfmake",
3
- "version": "1.0.7-staging.0",
3
+ "version": "1.0.7-staging.1",
4
4
  "description": "Client/server side PDF printing in pure JavaScript",
5
5
  "main": "src/printer.js",
6
6
  "browser": "build/pdfmake.js",
@@ -44,10 +44,12 @@ TableProcessor.prototype.beginTable = function (writer) {
44
44
  var headerRows = tableNode.table.headerRows;
45
45
 
46
46
  if (isPositiveInteger(headerRows)) {
47
- this.headerRows = headerRows;
48
-
49
- if (this.headerRows > tableNode.table.body.length) {
50
- throw new Error(`Too few rows in the table. Property headerRows requires at least ${this.headerRows}, contains only ${tableNode.table.body.length}`);
47
+ // Fix: If headerRows exceeds available rows, adjust to match body length
48
+ // This prevents errors when tables have empty bodies
49
+ if (headerRows > tableNode.table.body.length) {
50
+ this.headerRows = tableNode.table.body.length;
51
+ } else {
52
+ this.headerRows = headerRows;
51
53
  }
52
54
 
53
55
  this.rowsWithoutPageBreak = this.headerRows;
package/src/textTools.js CHANGED
@@ -316,6 +316,10 @@ function getStyleProperty(item, styleContextStack, property, defaultValue) {
316
316
  value = styleContextStack.getProperty(property);
317
317
  }
318
318
 
319
+ if(property === 'bold' && (item.text === '' || item.text === '\u200B')) {
320
+ return false
321
+ }
322
+
319
323
  if (value !== null && value !== undefined) {
320
324
  return value;
321
325
  } else {