-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
some PDF's can't be opened and generate "Invalid or corrupted PDF file." errors #3474
Comments
Reproduced the above issue when I attempted to open several banking statements under https://easyweb.td.com. The PDF opened in a new window and displayed the following (same error that @jumde mentioned above):
Seeing the following in the terminal:
Example of the browser console: Checked the following versions:
|
Duplicate of #884 |
With the link, I could see pdf pages after several times of reloading. |
I got more solid repro steps. |
I can confirm that refreshing the page with the error does load the PDF correctly in my application. This is a workaround, of course, but a good step forward in identifying the real issue so it can be resolved. |
I want to add that I also receive this error (PDF.js v2.0.673 (build: 31012570)
|
VERY interesting. I'd never thought to try that. |
What makes difference between loading |
After some debugging, I found that When I load I can reproduce this in chrome with its builtin viewer(pdfium). When I reload quickly, I can see exceed.html page in chrome. I'm trying to find the way to resolve this, but I'm not sure it can be fixed with pdf.js because pdf.js should request pdf url twice. |
Do you mean it should request it once? It seems that it ought to request it once and parse it, but the second request for the attempted workaround is triggering the exceed.html, which is apparently normal behavior for that server, probably as a DDOS attack mitigation. The server self-protection behavior is stopping the workaround from working, but the root problem is still the same as what I and others have been experiencing. |
Something else, if it can help. All of these begin with the standard: chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/ Then two sites that work:
The site that doesn't work:
Is there something related to the site that doesn't work not specifically defining |
@SilverPuppy brave requests twice to that server when user clicks pdf link. One is issued when user clicks the link. I assume that any server that provides pdf documents handles like that, current pdfjs extension would not work with that pdf link. It would be nice if pdfjs extension displays with contents from first request. |
@tripp-lc Thanks for checking! If it works with
I don't think so. |
I'll continue discussion about this issue in here - mozilla/pdf.js#10639. |
I came across a website which prevents the second request by plugin because it is "a direct request". Anyway, it should request once with referer information. |
I am experiencing a variant of this issue, with the same symptoms. In my case though, it's a result of the requests for the pdf file not including the cookies, resulting in a redirect to a login page. I commented on this issue describing the same problem, which was closed a few months ago: #2048 Version 0.61.51 Chromium: 73.0.3683.75 on macos Edit: It works fine when downloading the PDF and loading it from a file:// url. |
I want to confirm that I just updated my browser to: Version 0.61.51 Chromium: 73.0.3683.75 (Official Build) (64-bit) and the PDFs generated through my EHR site now renders correctly in a new tab. Thanks for your hard work. |
@gustavnikolaj Loading local file would be fine although it also needs two requests with same reason above. Local file system will give files always whenever user requests :) |
Unfortunately, whatever changed is not a full fix, because Google Calendar's PDFs for printing are still problematic requiring the refresh workaround. I am also on .61.51 |
Closing as a duplicate of #884 |
Test plan
See brave/brave-core#2342
Description
Cannot open PDF in Brave
Steps to Reproduce
Actual result:
PDF is corrupted
Expected result:
PDF should be displayed
Reproduces how often:
Easily
Brave version (brave://version info)
0.62.5 Chromium: 73.0.3683.39 (Official Build) dev (64-bit)
Reproducible on current release:
Website problems only:
The text was updated successfully, but these errors were encountered: