From 5988e542a327fb1852efd1b9b76bc3a8d6678c15 Mon Sep 17 00:00:00 2001 From: Gurbinder Singh <26441580+gurbindersingh@users.noreply.github.com> Date: Tue, 1 Mar 2022 22:59:19 +0100 Subject: [PATCH] Fix html2pdf (#528) --- src/commands/exportAsPDF.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/exportAsPDF.ts b/src/commands/exportAsPDF.ts index ed3654ff..2b256899 100644 --- a/src/commands/exportAsPDF.ts +++ b/src/commands/exportAsPDF.ts @@ -250,12 +250,18 @@ function offerOpen (destination) { }) } -export async function html2pdf (html: string, binaryPath: string, coverFilePath: string | undefined, footerCenter: string, filename: string): Promise { +export async function html2pdf ( + html: string, + binaryPath: string, + coverFilePath: string | undefined, + footerCenter: string | undefined, + filename: string +): Promise { const documentPath = path.dirname(filename) return new Promise((resolve, reject) => { const cmdArguments = ['--encoding', ' utf-8', '--javascript-delay', '1000'] - if (footerCenter !== null) { + if (footerCenter) { cmdArguments.push('--footer-center', footerCenter) } if (coverFilePath) {