Hi Keno Team,
I am getting this CORS error when trying to open a pdf file from an Azure blob using kendoPDFViewer. (Error: ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. )
I have an SSL token included to pdf/image URLs and work fine for image viewing with kendoImageEditor.
My code is simple as follows
this.viewer = $("#pdfViewer").kendoPDFViewer({
pdfjsProcessing: {
file: pdfUrl,
},
width: "100%",
}).data("kendoPDFViewer");
Could you please let me know how to fix this issue
Hi Manoj,
The observed error is CORS related. Please note, that CORS errors cannot be handled from the PDFViewer widget or the Kendo suite. Please make sure that the endpoint (Azure) is correctly configured to allow requests from the source you are sending the request.
For further information on how to allow CORS, you could review the following links:
- https://medium.com/@akhouri/cors-issues-and-resolutions-803e6abda52a
- https://stackoverflow.com/questions/28894466/how-can-i-set-cors-in-azure-blob-storage-in-portal
Regards,
Neli
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.