Search Posts

Author: Vanca

I’m using angular-pdf-viewer for PDF Preview but using PDFJS.getDocument gives no-cors error. How to fix this?

I’m using this library on my Ionic Project And I’ve used this code to load a document PDFJS.getDocument(‘http://localhost/books/book.pdf’).then(function(pdf_doc) { console.log(pdf_doc); }); But I’m getting this error whent trying to load a pdf document in Ionic V1. How can I solve this Fetch API cannot load http://localhost/books/book1.pdf. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access. If an opaque response serves your needs, set the request’s mode to […]