Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.url.createobjecturl(blob) not working in Edge #10173

Closed
patelsumit5192 opened this issue Oct 22, 2018 · 3 comments
Closed

window.url.createobjecturl(blob) not working in Edge #10173

patelsumit5192 opened this issue Oct 22, 2018 · 3 comments

Comments

@patelsumit5192
Copy link

patelsumit5192 commented Oct 22, 2018

Firstly, I tried all the questions & answers related to this topic. Additionally and I tried related questions and try to solve it but no the success. So please read my question thoroughly.

Search Questions:

  1. Displaying Blob PDF in Edge/IE11
  2. Windows Edge and opening a blob URL
  3. Blob download is not working in IE

I've searched related questions and tried to write the code but not had any success. I work with the PDFJS Project. I have open blob file in new tap. The below code works in all browsers (Chrome, Firefox, IE) but it's not working in Edge. I also use viewer.js in my project. I want to load my PDF file in Edge browser *Microsoft Edge 42.17134.1.0.

code

 var xhr = new XMLHttpRequest();
    xhr.open('POST', '/pdfblob.aspx', true);
    xhr.responseType = 'blob';
    xhr.onload = function (e) {
      var url = window.URL.createObjectURL(this.response);
      window.open('/web/viewer.html?file=' + url);
    };
    xhr.send();

This is the error I get:
https://i.stack.imgur.com/EXUQ4.png

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 22, 2018

I think the problem is that the file parameter only accepts a direct path to the PDF file; refer to https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#file. Otherwise, I think you need to call PDFViewerApplication.open(blob_data).

@patelsumit5192
Copy link
Author

I tried this PDFViewerApplication.open(blob_data) it is not working in Microsoft Edge 42.17134.1.0 . it was working in the previous version of Edge. the same function is also working in all other browsers (Chrome, Firefox, IE).

@Snuffleupagus
Copy link
Collaborator

[...] it is not working in Microsoft Edge 42.17134.1.0 . it was working in the previous version of Edge.

This rather clearly points to a bug/regression in the Edge browser, rather than in the PDF.js library/viewer, which should thus be reported to the Edge developers instead.

the same function is also working in all other browsers (Chrome, Firefox, IE).

This furthermore confirms that this isn't a general bug in PDF.js, and this issue should probably be closed as INVALID since there's nothing we can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants