Showing results for 
Search instead for 
Did you mean: 
Community Participant

PDF Uploaded in Canvas is not Displaying via API

Few months ago, we have started developing a custom application which is integrated in Canvas via LTI app. Part of this application is to fetch all the materials from a classroom and display it on our app. 

We have been able to fetch and display these PDF files in our app... until today. When I view the console log, it says....

Refused to load plugin data from 'Refused to load plugin data from 'PDF_FILE_URL%22%3B%20filename%2A%3DUTF-8%27%27M1%2520%252D%2520Introduction%2520to%2520HCI.pdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ4MSSRJNKVPQSSXA%2F20200829%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20200829T103014Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=dd46e5c5688244699421a2c8ae0105b02c807dc4f295f226666793defdeda1b7#view=Fit ' because it violates the following Content Security Policy directive: "object-src 'self'".' because it violates the following Content Security Policy directive: "object-src 'self'".

Although, we can still view the pdf file when we click the link. We can't just display it on our own webpage. We have not changed anything in our side. So I'm thinking it's on the server side of Canvas. Any idea?

Labels (1)
Tags (2)
0 Kudos
3 Replies
Community Participant

Do you get a grey screen by any chance when that happens?

Tags (3)

Initially, it's just a blank white screen. I added a fallback message to the <object> tag and use the direct link (same link used in the 'src') instead so that students can still access the file in the browser.

Okay, what about the help enter in the settings?  does it direct you to a pdf auto-download?

If so always keep that off. That's, not the problem anyway... hmmm.

Download a PDF viewer extension in Chrome. I can post a link?