I am trying to do a simple task of downloading a http response to a pdf. I am generating a pdf file but I am getting an error of "Failed to open PDF".
Here is what the response looks like.
And here is what I am doing.
let blob = new Blob([response.data], { type: 'application/pdf' })
FileSaver.saveAs(blob, 'foo.pdf')