Currently I am working on implementing the functionality to open PDF documents in AngularJS on desktop and mobile devices. I have been referring to the following resource: Open a PDF in a new window of the browser with AngularJS I have implemented a similar approach in my code, which looks like this:
**$http.get('generatePdfUrl')
.then(function (data) { // data is your url
var file = new Blob([data], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
});**
I have also tried using 'responsetype: 'arraybuffer'', and in the AngularJS web application, the URL points to blob://http://localhost:8080/126gyesdfsdfadjf, it successfully opens the PDF document using window.open(fileURL), However, the same approach does not work for the AngularJS mobile application built with Cordova. The application URL points to blob:file///126gyesdfsdfadjf, but it fails to open the PDF document. I would appreciate any suggestions or solutions for this issue. Regards, Vasu.