Created
July 10, 2025 19:57
-
-
Save dontpaniclabsgists/3ff9c07491387dea5bbb436d19eb8149 to your computer and use it in GitHub Desktop.
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
<button (click)="downloadAndDisplayPdf"> open your pdf </button> | |
private async downloadAndDisplayPdf(): void { | |
const win = window.open("", "_blank") | |
Manager.GetIllustrationDownload() | |
.then((response) => { | |
If (win) { | |
// these lines let us take a pdf file and get a blob url that we can use to navigate to it directly in browser | |
const pdfFile = new File([response.fileContent], response.fileName, { type: 'application/pdf', lastModified: Date.now() }); | |
const objectURL = URL.createObjectURL(pdfFile); | |
win.location = objectURL; // Navigate after async completes | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment