That's a client-side setting. Look through your browser settings - somewhere you can specify what should happen for a particular MIME type, whether it saves it, or tries to display it. That assumes your browser can display PDFs, obviously.
You don't generate the PDF "in the browser". You generate it on the server. The server then packs it into the response stream for the HTTP service request that caused the PDF to be generated.
When the client receives this response stream, it sees the "Content-Type" header which tells it that this stream contains a PDF and not HTML, an Excel spreadsheet, or something else.
The Content-Type is what is known as a MIME type (Multipart Internet Mail Extension), and the browser has a table of MIME types and actions to take, depending on which MIME type it receives. This table can usually be edited as part of the browser preferences, so that, for example, you can pick which one of possibly several different PDF viewer programs which open and display it or for it to simply display a File Save dialog and save the file without displaying it.
Also, you can use a Content-Disposition HTTP header to indicate that content that would normally be processed by a content application (PDF reader) should instead preferably be saved as a file, but there is no option for the reverse. For one thing, as I mentioned, if the client's normal behaviour was supposed to save the content, there wouldn't be a program defined to display it - you can only have one or the other.
The server cannot change this option, which is yet another protection against malicious servers. After all, if I could say that the action for content of type Application/X-pdf was "Format C:", I could really hurt a lot of website visitors (unless they run MacOS or Linux). Plus, I've probably got at least 3 different applications that can view PDFs, not counting a PDF editor or two on the machine I'm using now, so how would the service know which ones were installed or which one I preferred?
Aside from that, displaying a PDF in a browser window isn't even possible on many systems. A stand-alone viewer application must be launched. There was a patent filed controlling that sort of thing, and Microsoft got sued for half-a-billion dollars. And lost. Which is why Internet Explorer did not allow viewing PDFs - or even Excel spreadsheets - in a browser window ever since. Technologically it was possible. Pre-lawsuit IE versions and many Linux browsers could do it. But legally, they could not do it.
When it comes to destroying a civilization, gas chambers cannot hold a candle to echo chambers.
posted 2 months ago
I did a test in IE and it worked fine, show my report only in browser but in Google Chrome he open window to save pdf file.