1

I want to get the copy of the file in a variable which is downloaded as pdf using window.print(). Is there any event for window.print() which will give me the file before it is downloaded, like the @hasdownloaded event in vue-html2pdf package.

Thanks in advance

  • Which file? window.print doesn't deal with PDF. – Estus Flask Aug 05 '21 at 14:17
  • The `window.print` operates on the current `Document` (loaded within the browser) hence there is no file. If you are after the HTML of the Document you might try https://stackoverflow.com/questions/817218/how-to-get-the-entire-document-html-as-a-string – Peter Pajchl Aug 05 '21 at 14:30
  • Using window.print I could save the document also. So my requirement is that I want the copy of the document to be stored in my server for future reference. I there any event that will return the document. ( Please correct me if I am wrong with any terminology as I am a newbie ) – Aiswariya Aug 05 '21 at 15:59
  • [link](https://stackoverflow.com/questions/67999817/how-to-get-a-file-or-blob-from-window-print-or-window-save-in-variable) This is exactly what I need – Aiswariya Aug 05 '21 at 16:33

0 Answers0