You can use the following http headers:
Content-Type: application/pdf
Content-Disposition: inline; filename="filename.pdf"
This ensures that the browser will always display it on the browser window.
Submitted by Angelos Arampatzis on Sat, 11/17/2018 - 18:27
Related Question:
Open PDF files on browser by default instead of prompting users to download.