From 3e3efd66d7676842a7821d3bcfb99d6ba3d829c7 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Mon, 25 Sep 2023 21:19:02 +0200 Subject: [PATCH] added support for skipping header background, with headerColor: null Before the header background was always added, no matter the settings. Even if it was possible to make it ner transparent, it was never possible to make it completely transparent. This fixes that, and makes the header background completely optional, by setting headerColor: null --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6344638..41133ec 100644 --- a/index.js +++ b/index.js @@ -607,7 +607,10 @@ class PDFDocumentWithTables extends PDFDocument { }; // add background - this.addBackground(rectCell, headerColor, headerOpacity); + if (headerColor !== null) { + // add background + this.addBackground(rectCell, headerColor, headerOpacity); + } // cell padding cellPadding = prepareCellPadding(padding || options.padding || 0);