pdfThumbnails
pdfThumbnails copied to clipboard
Doesn't load when using an external file like from google drive
It can't load when we are using a link in src attribute like a google drive pdf 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
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">