For future people looking for answer. My solution was to remove the response header Content-Disposition which had been set to attachment; filename=....
Content-Disposition
attachment; filename=...
Together with Content-Type as application/pdf, the file is now showing in the new tab.
Content-Type
application/pdf