Opening PDF in browser

Is it possible to open a PDF always in a browser? That is no Download option will be provided by browser as a user will try to open that pdf file.

My application is in ASP.NET (C#).


Not all the time, it depends on the browser and the users settings. If I click on a direct PDF link it opens up in my PDF reader outside the browser.

Isn’t this a function of the browser itself? I believe it is up to the end user to select to download or view in browser. You can use Response.AddHeader and Response.ContentType but I still think the ability to download is available.

NightStalker-DNS has helped me out quite a bit on here, so here is my chance to give back. :slight_smile:

Attached is a sample of an embedded pdf in a web page. The good news is there is no need to write code.

It a complete one page website in .NET.

Let me know if you have any questions.


If you just link to a pdf, it will open within the browser, provided the user has adobe reader installed. Then they can download it from there.

You can embed a PDF in a web page. Will that work for you? Are you okay with the visitor being able to save the pdf once they are on the web page.

If so, I can post the code to embed a pdf in a web page; just let me know.