This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function saveToFile(byteArray, fileName) { | |
| const blob = new Blob([byteArray], { type: "application/pdf" }); | |
| const url = URL.createObjectURL(blob); | |
| // Note: A link element is used to set the file name | |
| const a = document.createElement("a"); | |
| a.href = url; | |
| a.download = fileName; | |
| document.body.appendChild(a); |