pdfThumbnails icon indicating copy to clipboard operation
pdfThumbnails copied to clipboard

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

Open razaq-yassine opened this issue 4 years ago • 2 comments

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

razaq-yassine avatar Mar 13 '21 00:03 razaq-yassine

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

ryzhovalex avatar Nov 03 '21 12:11 ryzhovalex

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">

agil3st avatar Dec 12 '21 12:12 agil3st