added save to pdf operation/cleanup
This commit is contained in:
parent
00569026f5
commit
f92dee1590
@ -508,6 +508,11 @@ class OutputWaiter {
|
|||||||
saveClick() {
|
saveClick() {
|
||||||
this.downloadFile();
|
this.downloadFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for save to pdf events
|
||||||
|
* Saves the current output to a file.
|
||||||
|
*/
|
||||||
savetopdf() {
|
savetopdf() {
|
||||||
this.downloadPdf();
|
this.downloadPdf();
|
||||||
}
|
}
|
||||||
@ -539,12 +544,12 @@ class OutputWaiter {
|
|||||||
}
|
}
|
||||||
const fileName = window.prompt("Please enter a filename: ", "download.pdf");
|
const fileName = window.prompt("Please enter a filename: ", "download.pdf");
|
||||||
|
|
||||||
// Assume if the user clicks cancel they don't want to download
|
//Assume if the user clicks cancel they don't want to download
|
||||||
if (fileName === null) return;
|
if (fileName === null) return;
|
||||||
|
|
||||||
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")
|
||||||
var 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, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user