You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm have an application that is streaming a pdf from server to client and then displaying it using pdf.js. I finally got it working on desktop browsers but on the Ipad I get the error "file origin does not match viewwer's". Here is the javascript code which I am using to pull the pdf stream (FileStreamResult) from the server and then load it to pdf.js:
var xhr = new XMLHttpRequest();
xhr.open('GET', '/DataProfile/GetPdf?projectId=M2419', true);
xhr.responseType = 'blob';
xhr.onload = function (e) {
if (this.status == 200) {
var blob = new Blob([this.response], { type: 'application/pdf' });
var url = URL.createObjectURL(blob);
var viewerUrl = '/pdfviewer/viewer.html?file=' + encodeURIComponent(url);
$("#frmMain").attr("src", viewerUrl);
}
};
xhr.send();
I'm guessing that for some reason the createObjectURL method is generating a url with a different origin even though it works just fine on all desktop browsers. Any help would be appreciated.
The text was updated successfully, but these errors were encountered:
Hello,
I'm have an application that is streaming a pdf from server to client and then displaying it using pdf.js. I finally got it working on desktop browsers but on the Ipad I get the error "file origin does not match viewwer's". Here is the javascript code which I am using to pull the pdf stream (FileStreamResult) from the server and then load it to pdf.js:
I'm guessing that for some reason the createObjectURL method is generating a url with a different origin even though it works just fine on all desktop browsers. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: