code cleaning

This commit is contained in:
Kutaz 2023-01-10 11:05:17 -05:00
parent f92dee1590
commit eaf61a07df

View file

@ -536,6 +536,9 @@ class OutputWaiter {
FileSaver.saveAs(file, fileName, false); FileSaver.saveAs(file, fileName, false);
} }
/**
* Handler for file download as pdf events.
*/
async downloadPdf() { async downloadPdf() {
const dish = this.getOutputDish(this.manager.tabs.getActiveOutputTab()); const dish = this.getOutputDish(this.manager.tabs.getActiveOutputTab());
if (dish === null) { if (dish === null) {
@ -549,24 +552,17 @@ class OutputWaiter {
const data = await dish.get(Dish.HTML); const data = await dish.get(Dish.HTML);
//console.log(data, "this is our 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(); const width = doc.internal.pageSize.getWidth();
doc.html(data, { doc.html(data, {
autoPaging: 'text', autoPaging: "text",
width: width, width: width,
windowWidth: width, windowWidth: width,
callback: function (doc) { callback: function (doc) {
doc.save(fileName); doc.save(fileName);
} }
}); });
} }
/** /**