Skip to content
New issue

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

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

Already on GitHub? # to your account

PDFs from Remote Server #842

Closed
firespeier opened this issue Nov 28, 2011 · 4 comments
Closed

PDFs from Remote Server #842

firespeier opened this issue Nov 28, 2011 · 4 comments

Comments

@firespeier
Copy link

Hey Folks!

I think this project is great...we are looking for a free html5 viewer for our project, but we really need to access PDFs from probably any html server. Because we want to present PDFs from URLs that are set by our users. Unfortunately that doesn't work with pdf.js yet, right? I really wonder what the problem is? Is this a java script issue or is it generally feasible to support that. It just would be great if it would work...if its not possible, do you guys have any idea how to work around this?

Thank you so much and keep up the good work!
Christoph

@saebekassebil
Copy link
Contributor

Due to Cross domain request limitations this is not possible for JavaScript in most cases. However, you can easily make a "proxy" script running on your own server, so that your javascript can access the file through this proxy, given an URL.

Not a PDF.js bug.

@brendandahl
Copy link
Contributor

It's also possible via CORS http://enable-cors.org/ .

@notmasteryet
Copy link
Contributor

duplicate of #522

@venuxvg
Copy link

venuxvg commented May 24, 2019

The following way worked for me

const proxyurl = "https://cors-anywhere.herokuapp.com/";
const docUrl = "https://example.com"; // site that doesn’t send Access-Control-*
const finalDocUrl = proxyurl+docUrl

so, use 'finalDocUrl' to get document via pdfjs

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants