Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created July 10, 2025 19:57
Show Gist options
  • Save dontpaniclabsgists/4a204f52461d8553b66b224539b123f0 to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/4a204f52461d8553b66b224539b123f0 to your computer and use it in GitHub Desktop.
<button (click)="downloadAndDisplayPdf"> open your pdf </button>
private async downloadAndDisplayPdf(): void {
Manager.GetIllustrationDownload()
.then((response) => {
// 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);
window.open(objectUrl, "_blank")
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment