Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 832
  • Last Modified:

Force PDF to open in browser

I have a web application which creates PDF reports dynamically using ceTe' s PDF Generator.  These PDF's are saved to the server and called with Response.Redirect(HttpContext.Current.Request.ApplicationPath + "/subdir/pdf/" + somename + ".pdf");

It seems that when the user has the full version of Adobe installed the it opens in Adobe Acrobat and if the user has only the reader installed then it opens in Internet Explorer.

Is there a way to force the PDF document to open in the browser?
1 Solution
why don't you have a page to display this pdf always... and do a response.redirect(DisplayArticle.aspx?filePath=HttpContext.Current.Request.ApplicationPath + "/subdir/pdf/" + somename + ".pdf")... in that DisplayArticle.aspx, you can control how to display the pdf file.. probably can have an iframe whose iframe.src = pdf filepath..

esc7Author Commented:
I will try your suggestion and get back to you.  Thanks for the response.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now