2

How to get a file or blob from window.print() OR window.save()?

let blobFile: File;

    window.save(savedFile =>{
      blobFile = savedFile
    })

OR

    window.print(printedFile =>{
      blobFile = printedFile
    })
  • [`window.print()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/print) does not take any arguments? – evolutionxbox Jun 16 '21 at 09:23
  • https://stackoverflow.com/a/23610441/989920 may help? – evolutionxbox Jun 16 '21 at 09:24
  • There isn't any `window.save` function. As @evolutionxbox noted, `window.print` doesn't take any arguments; it just triggers the browser's print dialog. If you are trying to listen for when the user tries to print or tries to save the current page, [these](https://stackoverflow.com/questions/4197955/is-it-possible-to-catch-browsers-file-open-save-dialog-event-using-javascript) [links](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeprint) might help. – Mark Jun 17 '21 at 03:29

0 Answers0