Skip to content

Commit

Permalink
Fix html2pdf (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurbindersingh committed Mar 1, 2022
1 parent e152562 commit 5988e54
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/commands/exportAsPDF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,18 @@ function offerOpen (destination) {
})
}

export async function html2pdf (html: string, binaryPath: string, coverFilePath: string | undefined, footerCenter: string, filename: string): Promise<string> {
export async function html2pdf (
html: string,
binaryPath: string,
coverFilePath: string | undefined,
footerCenter: string | undefined,
filename: string
): Promise<string> {
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) {
Expand Down

0 comments on commit 5988e54

Please sign in to comment.