A Node JS application component makes the following call to the server where the response (res) contains a PDF file in the response body.
this.$http.get('/resource/download/' + file.id)
.then((res) => {
console.log('back w/ PDF');
}
);
I can view the PDF data in the response body and have compared it to downloading the same PDF and it looks correct.
How can I display the response in a new tab in the browser so the user can view the PDF?
EDIT:
The "res" parameter return parameter from the $http.get() call is not a URL but the response object from the Node JS app on the server. In the response object the .data property contains the PDF. If this were written to a file it would be a PDF file.
The app interfaces w/ the Google Drive API and we are getting the PDF contents when the user clicks on a file name in our website. We can't provide a link to the PDF on the Google Drive directly because that would require the user to have shared access to Google Drive to view the PDF file.
Is there a way to put the PDF data in a separate browser tab or even embed it in an iFrame?