I'm having a trouble with getting my pdf to show up. I get the file data as byte array. This is what I have at the moment:
// data is originally String {0: % 1:P 2:D ...}
const byteArray = _.map(data); // ["%", "P", "D", "F", "-", "1", ".", "4", "↵", ...]
const blob = new Blob(byteArray, {type: 'application/pdf'});
const blobURL = URL.createObjectURL(blob);
window.open(blobURL),
Blob shows up when I log it and it has proper length and all. For some reason the pdf opens but is empty. Only the header in the tab is right (so there must be something right?). There is a possibility that the fault is in the backend where I get the data from but I'm not sure as I don't have access to it. You may also suggest better formats to transfer the data from backend if that is necessary.
Could the data be presented wrong in it's original form?
Edit:
When I do the request with postman, it displays the file correctly without me doing anything