Opening PDF in Web Browser(IE)

Hi,
I have written a program to download PDF file. When user will click on "Download" link, PDF file should open in web browser IE itself. Currently file is opening in separate window. I am creating this PDF file run time and it is not stored in harddisk. In Acrobar Reader, I have checked the check box "Display PDF in browser". Despite this it is opening in separate window.
I have written following code:
byte abyte0[] = pdfGenerator.generatePDF(getXslFile(instancedata), new String(instancedata.requestResult.message, "UTF-8"));
httpservletresponse.setHeader("Cache-Control", "no-cache");
httpservletresponse.setHeader("Cache-Control", "max-age=0");
httpservletresponse.setHeader("Content-Disposition", "inline; filename=" + instancedata.userId + "_" + System.currentTimeMillis() + ".pdf");
httpservletresponse.setContentType("application/pdf");
String s = new String(abyte0, "UTF-8");
servletoutputstream = httpservletresponse.getOutputStream();
servletoutputstream.write(abyte0, 0, abyte0.length);
servletoutputstream.flush();
Kindly suggest what is required to open PDF in Web browser (IE).
Regards,
Dev

I don't see anything wrong here offhand.
In your download link, you aren't using target="new" or anything, are you?

Similar Messages

  • Unable to open PDF in Web Browser and delay for printing

    In my LAN, on several PCs running with Windows 7 (32 and 64 bits), I observe two problems with "Acrobat Reader XI":
    - Delays / unable to open pdf files in the web browser (Internet Explorer).
    - Delays in printing: for example it takes over 8 minutes to print a pdf file: 400kB for two pages (on different printers / models).
    Here's the list of actions that I've allready tried to issue those problems:
    For the Web Browser problem :
    - Repair the "Acrobat Reader XI" installation.
    - Uninstalling and Installing Acrobat Reader.
    - In the web browser, disabling and activating the add-on (Adobe PDF Reader).
    - Uninstall "Acrobat Reader XI" and install "Acrobat Reader X"
    Temporary issue: downgrade to "Acrobat Reader 9", which solves the problem with the web browser.
    For the printing delay:
    - Repair the "Acrobat Reader XI" installation
    - Change the printers drivers (install Universal Drivers PCL)
    - Check the box: "Print As Image" before printing
    Any Idea ?

    You can get that error if there is still an old Adobe Reader plugin in the plugins folder in the Firefox program folder.
    C:\Program Files\Mozilla Firefox\plugins\nppdf32.dll
    See also http://kb.mozillazine.org/Adobe_Reader

  • Cannot View PDF in Web Browser error

    Using windows XP sp3 has adobe reader 9 on it...
    Installing Adobe Acrobat 9 Pro extended was trouble prone enough, but now there is more...
    When trying to open a PDF in a browser window, you get the following dialog error message (sample site:http://support.apple.com/manuals/#iphone)
    "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.
    Adobe Acrobat/Reader version 8 or 9 is required. Please exit and try again."
    For the cost of this program, I expected better. The above was not a problem before installing Adobe Acrobat 9 Pro extended.
    Please advise.
    Thanks
    bob

    I did a google search and found a fix that was a bunch of registry entries that worked for me:
    Ted Neubauer, "Reader 9 won't open PDF from web browser" #15, 15 Jul 2008 7:47 am
    It is just anoying to spend this kind of money on a piece of software and have so many problems out of the box.
    Yes, I have run the updater software.
    What is the phone number for adobe support?
    Thanks
    Bob

  • One or more PDF documents are open inside a web browser - message

    Hi,
    I have a new L series notebook and its great. The only foible I can think of is a message I keep getting when I try to shutdown. There is a message box that says "One or more PDF documents are open inside a web browser. If you exit adobe reader now, those documents will be closed. Are you sure you want to exit?".
    The thing is I do not have any PDF's or web browsers open at the time! Can you help me please?
    Thanks, Mark.

    Hi Mark
    Believe me its nothing serious the same happens on my notebook from time to time
    Usually the PDF files can be read with the Adobe Acrobat reader. This application service runs in the OS background and this message can appears if the Adobe Acrobat reader cannot close the background process automatically
    I have solved this tiny problem by removing the acrobat reader from the system. After new reboot I have reinstalled it again
    Now the message does not appear and all runs like a dream ;)

  • Error message says need Adobe reader 8 or 9 installed to open pdfs from web pages yet Reader 9alredy

    Error message says need Adobe reader 8 or 9 installed to open pdfs from web pages yet Reader 9 is alredy installed on computer. Is this a 64 bit ossue although I am sure I did not have this problem prior to a replacement hard drive being installed.

    What is your operating system, browser?
    What is the exact message you are getting?

  • Unable to open PDF file in browser using Reader 9 with IE8

    I just updated to IE8 and when trying to open a PDF file on the browser, I received a message stating to use Adobe Reader 8 or 9.  I downloaded AR9 and still receive the same message and cannot open PDF files in browser window.  It defaults to my Adobe Acrobat 6.0 which will not open the file.  I have Windows XP.  I do not have a problem opening a PDF file in Yahoo mail with AR9.  I have tried many different ideas on the web to no avail.  Appreciate any help to be able to default to open PDF files in the browser using AR9 which is apparently required by IE8.

    Fixed problem by taking to a computer store to find that my hard drive storage was maxed out.  I had the hard drive repaced with a larger amount of storage.   Problem resulted from inadequate amount of storage space which prevented me from downloading and installing Adobe Reader 9.
    Thanks to al that responded.  

  • How to Open PDF in the browser...JSF

    String strUrl = http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf
    FacesContext faces = FacesContext.getCurrentInstance();
    ExternalContext context = faces.getExternalContext();
    HttpServletResponse response = (HttpServletResponse)context.getResponse();
    response.sendRedirect(strURl);          Hello,
    I have to open PDF in the browser, I am trying to redirect using the above code, but it is throwing exception as below. Could some one help me in this issue?
    Thanks In advance
    Error Message:
    java.lang.IllegalStateException: Cannot forward after response has been committed
    Error details:
    java.lang.IllegalStateException: Cannot forward after response has been committed
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:313)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         at com.esri.adf.web.faces.application.ADFViewHandler.renderView(Unknown Source)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at com.esri.adf.web.util.ADFSessionTimeoutFilter.doFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)

    You cannot send two responses per request. The solution is to let the client create two requests. Common approach is to add an onclick to the commandbutton/commandlink which opens the PDF in a new browser window and let the actual command action invoke a redirect on the current browser window.
    E.g.<h:commandLink value="Download PDF" action="#{myBean.action}" onclick="window.open('http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf');" />where the #{myBean.action} invokes a redirect and the http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf opens the PDF in the new window.
    Edit
    I've read your question/problem once more and now I am a bit confused. All you want to do is to open the PDF file in a new window and you don't need to do something in the backing bean? Just use a link with target="_blank".
    <h:outputLink value="http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf" target="_blank">Download PDF</h:outputLink>No need for a redirect here.
    Edited by: BalusC on Nov 21, 2007 7:21 AM

  • Open pdf in mobile browser (share point 2013)

    hello,
    I need to Open pdf  in mobile  browser (share point 2013).i tried browser handling type in  permissive mode.
    but i couldn't view the pdf when i access through mobile browser.
    is there any work around to do this .?
    any help would be appreciated.
    Thanks regards, Vignesh.

    Per the earlier thread, your best bet is to use Office Web Apps in conjunction with SharePoint 2013 to display PDFs. Otherwise a browser needs a control (which most if not all mobile browsers will not have) to handle viewing PDFs in the browser.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Cannot use Adobe Reader to view PDF in web browser error

    I have a new computer and have Acrobat Pro installed.  When I try to click on PDF links in browsers, I get an error:
    Cannot use Adobe Reader to view PDF in web browser.
    I want to be able to open these links using Acrobat Pro.  What can I do in Internet Explorer so I don't always receive these errors, and so pdfs automatically open using Acrobat Pro?
    Steve

    Because it was not designed for Windows 7 doesn't mean it cant run.
    If you install the applications as administrator, you shouldn't have problems. I have installed both Reader and Pro versions on Windows 7 32 and 64 bit without problems, as long as I did it as administrator. You right click on the setup and select Run as Administrator. You don't need to do it for updates if you go through the update option on the help panel.

  • I have Adobe Reader in stalled on my MacBook Pro but the plugin is not showing in FireFox so I am unable to open pdf's in browser. How can I correct?

    When I encounter a site that requires me to fill in a pdf form the browser opens in Adobe Reader and not in the browser. I have checked off in Adobe Reader to open pdf's in browser but it still will not.

    I do not think adobe reader works as a plugin for Firefox on Macs, ( but a PC user myself so I can not check). See [[Installing and updating Adobe Reader]]
    Note specifically comments in the Mac version of that [/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox?s=pdf+plugin+mac&as=s#os=mac&browser=fx35] about alternative plugins.

  • "This form cannot be opened in a web browser. to open this form use microsoft infopath" while adding a new Approval - Sharepoint 2010 and Publishing Approval workflow.

    I am trying to add a new workflow to a document library with the below mentioned settings and getting error saying "This form cannot be opened in a web browser. to open this form use microsoft infopath" while adding a new Approval - Sharepoint
    2010 and  Publishing Approval workflow" . For your information the I have checked the server default option to open in browser.
    Versioning Settings.
    Error
    This is quiet urgent issue . Any help would be really helpful.. Thanks.. 

    Hi Marlene,
    Thank you very much for your suggestions.
    But I am not creating a custom workflow in designer as Laura has mentioned. I am instead trying to create a new Out of the box Approval Workflow and I get the error mentioned above.
    As it works in other environment, I tried figuring out the possible differences which can lead to this error.
    Today I found one difference which is there are no form Templates within Infopath Configurations in Central Admin. Now I am trying to figure out what makes this form templates to be added to the template gallery.
    Regards,
    Vineeth

  • Macbook Air wont's open PDF in Safari browser Version 7.1 (9537.85.10.17.1)

    Hi Guys, can anyone help me out here i bought a new 2014 Macbook Air with a maverick's OS X Version 10.9.5 and it wont's open PDF in Safari browser Version 7.1 (9537.85.10.17.1). I have a adobe reader Version IX 11.0.09
    this is the message i get when i open up a pdf on safari
    To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html
    For further support, go to www.adobe.com/support/products/acrreader.html

    i did this is what it says;
    To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html
    For further support, go to www.adobe.com/support/products/acrreader.html
    and when i go to my library under internet plug-Ins there's nothing in the file.

  • Open PDF in same browser when the preference is set to open in new window.

    The corporate policy for all applications is to open the PDF document in new browser/reader but our application needs the reader to open in the same browser even the preference "Display PDF in Browser" is unchecked.... The setPreference from javascript (html) doesn't seemed to work... How do i make this work?
    Also, I need the links the browser to open in new browser once the PDF is loaded... do I need to reset the preference once it is loaded for the links to open in new browser?
    thanks,
    - Ray

    There is no way to override that from your application.   And if the Links in the PDF have an explicit "open in new window" setting, that is respected over the preference.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Wed, 19 Oct 2011 22:02:53 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Open PDF in same browser when the preference is set to open in new window.
    Open PDF in same browser when the preference is set to open in new window.
    created by h_ray<http://forums.adobe.com/people/h_ray> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/3981167#3981167

  • Cant open pdf files in browser

    Cannot open pdf files in browser but can open from hard drive. Using Adobe 11.0.02 with Windows 8. Have uninstalled Reader and reinstalled and then restarted PC; Checked for updates; used the Repair selection on the menu. Frustrated. Suggestions?

    Hi adityabhargava01-
    My first suggestion is to upgrade to the most recent version of Firefox by going to this link:
    http://www.mozilla.org/en-US/firefox/new/
    My second suggestion is to read this article on how to many your preferences on how Firefox deals with PDFs and all other file types:
    [[Options window - Applications panel]]
    I hope that helps!

  • Loading a website without opening a new web-browser

    Can someone tell me how to load a webpage without opening a new web-browser, having it displayed on the current one...
    I have tried the following code but it opens up a new browser instead... :
    getAppletContext().showDocument(new URL("http://www.angelfire.com"), "_blank");
    Million thanks

    getAppletContext().showDocument(new URL("http://www.angelfire.com"), "_self");

Maybe you are looking for