I\'d like to open Blob object in a browser window.
This code works everywhere but iOS Chrome (and IE of course but I can solve IE). The window is not redirected to
FileReader.readAsBinaryString method has been deprecated.
Bit late, but I had todo something similar using the FileReader.readAsDataURL - which produces a dataUrl. I'm using AngularJS $http service to call the API to create a pdf. Hope this helps, see below:
$http.post('/api/pdf', {id: '123'}, {responseType: 'arraybuffer'})
.success(function (response) {
var blob = new Blob([response.data], {type: 'application/pdf'});
var reader = new FileReader();
reader.onloadend = function(e) {
$window.open(reader.result);
}
reader.readAsDataURL(blob);
});