From eaf61a07df52ff51d8a7ddac9073545bfd8e08da Mon Sep 17 00:00:00 2001 From: Kutaz Date: Tue, 10 Jan 2023 11:05:17 -0500 Subject: [PATCH] code cleaning --- src/web/waiters/OutputWaiter.mjs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/web/waiters/OutputWaiter.mjs b/src/web/waiters/OutputWaiter.mjs index c8e2fb0d..4dbc183b 100755 --- a/src/web/waiters/OutputWaiter.mjs +++ b/src/web/waiters/OutputWaiter.mjs @@ -535,7 +535,10 @@ class OutputWaiter { file = new File([data], fileName); FileSaver.saveAs(file, fileName, false); } - + + /** + * Handler for file download as pdf events. + */ async downloadPdf() { const dish = this.getOutputDish(this.manager.tabs.getActiveOutputTab()); if (dish === null) { @@ -549,24 +552,17 @@ class OutputWaiter { const data = await dish.get(Dish.HTML); //console.log(data, "this is our html") - const doc = new jsPDF('p', 'px', 'a4'); + const doc = new jsPDF("p", "px", "a4"); const width = doc.internal.pageSize.getWidth(); doc.html(data, { - autoPaging: 'text', + autoPaging: "text", width: width, windowWidth: width, callback: function (doc) { doc.save(fileName); } }); - - - - - - - } /**