From b604cb63c8b4a28e4c31708460463ea492cf696e Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Tue, 11 Apr 2023 20:37:34 +0530 Subject: Using a seperate HTML file for the generating the PDF. Putting the footer at the bottom of each page. --- src/shared/download-pdf.ts | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/shared/download-pdf.ts (limited to 'src/shared/download-pdf.ts') diff --git a/src/shared/download-pdf.ts b/src/shared/download-pdf.ts deleted file mode 100644 index bd8f815..0000000 --- a/src/shared/download-pdf.ts +++ /dev/null @@ -1,17 +0,0 @@ -export const downloadPDF = (content: string) => { - const tab = window.open("about:blank", "_blank"); - - if (tab) { - tab.document.write(content); - tab.document.close(); - tab.focus(); - Promise.all(Array.from(tab.document.images) - .filter(img => !img.complete) - .map(img => new Promise(resolve => { - img.onload = img.onerror = resolve; - }))).then(() => { - tab.print(); - tab.close(); - }); - } -}; -- cgit v1.2.3