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

Doesn't load when using an external file like from google drive #7

Open
razaq-yassine opened this issue Mar 13, 2021 · 2 comments
Open

Comments

@razaq-yassine
Copy link

It can't load when we are using a link in src attribute like a google drive pdf link

@ryzhovalex
Copy link

pdf.js has CORS enabled. You cannot ask random URL to provide data for the different web site. Download PDF and code on your web site to play with the script.
source
related stackoverflow answer

@agil3st
Copy link

agil3st commented Dec 12, 2021

If you deal with list of thumbnails, better check each file URL. Invalid one of the URL can cause all other links are broken.

This is my SilverStripe 4.0 HTML code. $DriveLink contains Google Drive URL https://docs.google.com/uc?export=download&id={FIleID}.

<img alt="single" class="img-responsive pdf-cover" data-pdf-thumbnail-file="$DriveLink" data-pdf-thumbnail-width="300" data-pdf-thumbnail-height="350">

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

No branches or pull requests

3 participants