I have an application with ASP.NET Core back end, and Angular front end. Client has the following code:
this.myService.getSummary(this.personId, summaryType).subscribe(res => {
let url = window.URL.createObjectURL(res.body);
this.innerHtml = this.sanitizer.bypassSecurityTrustHtml(
"<object data='" + url + "' type='application/pdf' class='embed-responsive-item' style='width: 100%; height: 500px;'>" +
"Object " + url + " failed" +
"</object>");
this.loaderService.commonLoader = false;
}
Generated HTML is, as expected:
<object data="blob:https://myserver.com/f612fd9e-0656-41a2-b371-e6a13a8603e5" type="application/pdf" class="embed-responsive-item" style="width: 100%; height: 500px;">
Object blob:https://myserver.com/f612fd9e-0656-41a2-b371-e6a13a8603e5 failed
</object>
I can see that the PDF comes from the server correctly, and on most computers it is displayed properly. However, there are a few machines where I get
Object blob:https://myserver.com/f612fd9e-0656-41a2-b371-e6a13a8603e5 failed
Non-embedded PDFs are shown correctly, and I can even open this blob:https://myserver.com/f612fd9e-0656-41a2-b371-e6a13a8603e5
in a new tab.
Since it is happening on only a few machines, it's probably something in the environment. Maybe some Acrobat settings or whatever. My question is how can I troubleshoot this problem in client environment? I don't get any error in the console or in Windows event viewer. The problem happens in both Chrome and Edge.