Force PDF to open in browser

Posted on 2006-04-13
Last Modified: 2008-02-01
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?
Question by:esc7
    LVL 3

    Accepted 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..

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now