We have an Angular application that gets some input parameters and sends them to the back end where they get processed. The processing result is a pdf file that we want to o
Inside else condictional code above, insert this following code below:
var file = new BLob([response.data), {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
// create tag dinamically
var fileLink = document.createElement('a');
fileLink.href = fileURL;
// it forces the name of the downloaded file
fileLink.download = 'pdf_name';
// triggers the click event
fileLink.click();