Initially the question looked to be solvable by modifying the headers, so I left a comment with some related suggestions. However, after further comments from the OP as to what was tried, some testing I tried (see below), and with the help of an answer from user Helping Hands (that got deleted by the system automatically after the migration, but appears on the Super User site), it appeared the issue is specific to Chrome's Chrome PDF Viewer plugin, which is installed and enabled by default. This is also confirmed in the answers to DisgruntledGoat's question on Super User here.
Prior to migrating, I tried modifying the header and MIME type, which worked for other browsers, but not for Chrome. Disabling the Chrome plugin solved the issue though. Therefore since the question was specific to the function of a particular web browser, and as indicated in the list of things considered off-topic here (i.e., the usage of web browsers), I migrated it to Super User where it could receive more attention and was a better fit.
If there was a programming solution possible, as the OP later commented they were thinking about using JavaScript in attempt to solve, that too would be considered off-topic here, so I suggested the OP post another question regarding that on Stack Overflow.