-
Notifications
You must be signed in to change notification settings - Fork 10
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
It possible to get external pdf file? #13
Comments
Hi, There must be a problem with your CORS setup and the response from your server. I'm not an expert on the subject so I might not be able to help further, but can you post your server response to the OPTIONS method? I found the following piece of code in my various tests with CORS (unrelated to angular-pdf-viewer) but I don't know if it's safe to use in production (probably not; use with caution). My comments say that it works, so I'll paste it here in case it helps you somehow (PHP on Apache).
|
There are 2 problems I can see in your case.
So, I'm afraid this won't work. Your best bet is to somehow authenticate against the server on your own, download the PDF as a blob and give to angular-pdf-viewer via the file attribute instead of the src. And this will work if and only if the server support CORS. Hope that helps somehow. Unfortunately, (as I said) I'm not fully qualified to give you a definitive answer, so don't take my words for granted :) |
Thanks again! I'm thinking about other alternative, is possible send to the library directly the binary file? example encode in bat64 Thanks! |
The directive supports setting either a URL in the It creates a In your case you can try downloading the PDF from the remote server, converting it into a |
Hi, we are using this plugin for our project. It works fine in Chrome browser, but IE 11 the pdf file is not getting viewed. We are not getting any error in console. kindly help us to resolve it. Thanks |
Try the fix suggested on the following issue or try updating pdf.js. PRs are welcome :) FWIW, I just tried loading the demo on IE11 with the debugger open and it reports an error at the location described in the above issue. |
I've tried setting "cors" on my server but still can not get it, can you help me?
Thanks!
The text was updated successfully, but these errors were encountered: