Show PDF in IE browser

Hi, I am experiencing a problem with the IE browser. What I am doing is, I receive a PDF file from a server and write the whole PDF file on the outputstream of the browser, with certain headers that need to be set. The Netscape shows the PDF nicely inside the broswer using adobe plugin, but IE instead opens up a file download box(doesnt ask me to save/cancel) and then start the standalone adobe acrobat reader program (not inside IE) and display's the message "File not found". Below is the code.
java.net.URL pathToReportURL = new java.net.URL(path);
java.net.HttpURLConnection conn = (HttpURLConnection)pathToReportURL.openConnection();
conn.setAllowUserInteraction(false);
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
conn.connect();
String contentType = conn.getContentType();
response.setContentType(contentType);
int contentLength = conn.getContentLength();
response.setContentLength(contentLength);
response.setHeader("Content-Disposition", "inline; filename=name2.pdf");
BufferedInputStream  bis = new  BufferedInputStream(conn.getInputStream());
BufferedOutputStream bos = new BufferedOutputStream response.getOutputStream());
    byte[] buff = new byte[2048];
    int bytesRead;
    while(-1 != (bytesRead = bis.read(buff, 0, buff.length)))
        bos.write(buff, 0, bytesRead);
    bis.close();
    bos.close();
    conn.disconnect();The content type is set as application/pdf properly and the Content-Disposition is set to inline with the filename specified. Anybody have a clue ?

One thing I am confused about is that , Isn't
"Content-Disposition : Inline" supposed to
o show the PDF inside the browser.No, 'inline' only means that it is not an attachment, so you don't get the 'Save As' dialog.
It can also be that it is an Adobe configuration issue. In Adobe, choose Edit/Preferences/Internet, and verify that the box �Display PDF in Browser� is checked.

Similar Messages

  • When I click on show pdf in a browser then safari goes black. What to do?

    When I click on show pdf in a browser then safari goes black. Other browser like firefox work. What to do in Safari?

    Have you installed any PDF plugins or Adobe Acrobat Reader?  Schubert-it's PDF Plugin and Adobe's Acrobat Reader both may need updates to work properly in Safari.  Double check if you have either which version needs to be installed.

  • Show PDF document in Browser (Internet Explorer)

    Hi
    I need to show a PDF document in Internet Explorer.
    We have some static PDF documents in the application. Depending on user selection we determine the name of the PDF document and somehow we have to display in Browser.
    Refer below code, steps and problem.
    Step 1) I convert the PDF document to ByteArrayOutputStream using below code in a Java class and store this stream to a session variable.
    File pdfFile = new File("c:\\temp.pdf");
    byte[] data = new byte[(int) pdfFile.length()];
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    FileInputStream fileInputStream = new FileInputStream(pdfFile);
    int count = 0;
    while (fileInputStream.read(data) != -1)
    byteArrayOutputStream.write(data, 0, count);
    Step 2) After this the control is transferred to a servlet. It retrieves the stream from session variable and does following (Servelt is called such that it should open new browser window. This is OK.)
    response.setHeader( "Content-disposition", "inline; filename = avb.pdf");
    response.setContentType("application/pdf");
    response.setBufferSize(byteArrayOutputStream.size());
    response.setContentLength(byteArrayOutputStream.size());
    try
         byteArrayOutputStream.writeTo(response.getOutputStream());
         response.flushBuffer();
    catch (IOException e)
         //Handle execption               
    PROBLEM: It asks to save pdf document. But after saving I am not able to open document. It shows messge that the document is not of PDF type. But it is actually a PDF so my guess is that something is wrong in above code snippets.
    Please help.
    Thanks.

    FileInputStream fileInputStream = new FileInputStream(pdfFile);
    int count = 0;
    while (fileInputStream.read(data) != -1)
        byteArrayOutputStream.write(data, 0, count);
    }Poor unloved count variable.

  • Adobe Illustrator CS5 does not show PDF thumbnails when browsing

    When I am browsing through PDF files to open one of them in Adobe Illustrator CS5 it does not show the thumbnail.  When I am browsing in Adobe Acrobat it does show the thumbnails.  If I have Adobe Acrobat open and am browsing through files and the thumbnails are showing then if I open Adobe Illustrator and browse for a file the thumbnail does show up. 
    How can I get Illustrator to always show the PDF thumbnails.  I have to frequently browse through thousands of PDF files and it is imperative that I can see the thumbnail for these PDF files.  I primarily use Illustrator to edit PDF files.
    The computer is Windows 7 Enterprise 64 bit edition.  Thumbnails barely work when browsing files through Explorer.  Some thumbnails will show, but not very many of them and it is extremely slow to load the thumbnails that will display.

    Bob,
    So I am assuming you are talking about viewing the files using this method first:
    To use the 32-bit version of Windows Explorer, follow these steps:
    Click Start, click Run, type the following in the Open box, and then click OK:
    Drive_Letter:\windows\syswow64\explorer.exe /separate
    Note The placeholder Drive_Letter represents the drive where the x64-based version of Windows is installed.
    Please let me know if I am missing what you are saying here.

  • Issues showing PDF files in web-browser (Windows 7 x64, 32-bit version of AdobeReader X)

    I'm not sure if this is the right way to share my experience, but at least I know Google will discover this thread eventually and maybe someone else will find what I have been looking for the past 3 hours
    I'm deploying the 32-bit based AdobeReader X (http://www.adobe.com/support/downloads/detail.jsp?ftpID=4950) to Windows7 32-bit and 64-bit based machines. This is a MSI deployement done through our Active Directory. Everything goes well - no errors. Except for the x64-based machines having trouble showing PDF-files in the web-browser.
    I used Adobe Customization Wizard X to customize our MSI installation - this showed out to be the solution once again.
    Common for the installation on Windows7 32-/64-bit were that the value in the registry database for HKCR\Software\Adobe\Acrobat\Exe (Default) was set to "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe". This is valid for the 32-bit installation as Program Files is situated in C:\Program Files, but since it's a 32-bit edition of AdobeReader that I'm installing on the 64-bit based system as well, it's installed in C:\Program Files (x86) and the reference in the registry database to "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" is therefore not valid - which explains why PDF files could not be displayed in the web browser. Changing the registry to "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" solved it. Now this is a manual solution which might be useful on 1-2 machines but on a bigger scale it's not the right way to do it.
    I could change it with a batch/vbs script but still this is only a solution of the symptom and not a solution to the core issue. I therefore focused on Adobe Customization Wizard X again.
    The problem was easily solved. I opened the MSI file, loaded the transform file that I've made previously. Went to Registry > HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe . I then changed the (Default) value from "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" to "[INSTALLDIR]Reader\AcroRd32.exe", generated the MST file and replaced my current one for distribution. Problem solved! :-) The entry in the registry now shows : "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" and PDF files are open without any issues.
    I hope someone can save a bit of time on this one.
    Best regards!
    Alex Mikkelsen

    I was able install and view the files in adobe reader 10.1.1 and in web browser window 7 64 bit machine.  But when I go to Edit-preferences-internet and  unchecking "display PDF in Browser" , I am not able to view the pdf files in ie 9 browser.  I have used this javscript to check for pdf version.
    Immediately after installing adobe--
    when I do adobe test in ie 9---https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html--  launches a test pdf file--Acro_Test.pdf
    After unchecking-- it stays in the  https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html instead of showing test pdf file--Acro_Test.pdf
    Tried to go back to "display PDF in Browser"--it is showing it is checked(eventhough I did not check it)
    and in ie
    it stays in the https://courses.worldcampus.psu.edu/public/diagnostics/Acrobat.html instead of showing test pdf file--Acro_Test.pdf

  • How to set up Internet Explorer 9 to show pdf in Adobe Reader instead of web browser

    Hi,
    I'm using Windows 7 (64-bit), Internet Explorer 9 and Adobe Reader IX (v.11.0.00).
    I would like to set up Internet Explorer 9 to show pdf-files in Adobe Reader program windows instead of viewing pdf-files within the web browser. Adobe Reader IX doesn't have the setting "Display pdf-files in browser" any longer, earlier versions of Adobe reader did have that setting.

    Read this:
    http://forums.adobe.com/thread/1082459

  • How to show PDF with web.show_document in a separate browser frame (forms10g)?

    I'd like to show PDF in a separate browser frame or in the same window, but at the same time with form screen. So, I'd like to have form in the left and showing pdf in the right. PDF is runing on web.show_document. I understand that this is imposible (btw: does anyone know when it's going to be posible?), but I'd like to figure out if someone have already made some kind of solution?
    Thanks.

    I'd like to show PDF in a separate browser frame or in the same window, but at the same time with form screen. So, I'd like to have form in the left and showing pdf in the right. PDF is runing on web.show_document. I understand that this is imposible (btw: does anyone know when it's going to be posible?), but I'd like to figure out if someone have already made some kind of solution?
    Thanks.

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

  • How to open a pdf package in browser when multiple files are bound together.

    Hi,
    I have to open a pdf package in browser that contains multiple pdf files any suggestions will help me a lot.
    Thanks.

    It shows me a page says "Multiple files are bound together in this PDF package"

  • Showing pdf in Fire fox giving problem

    Hi every body ,
    I have a problem related to PDF showing in the browser , It is working fine in the IE , but in the FF it is not showing .
    Here is my Backing bean code for fetching the PDF .
    The main backing bean name is myBean.
      public void showPDF() throws IOException  
              BufferedInputStream input = null; 
              BufferedOutputStream output = null; 
              InputStream inputStream =null;  
              FacesContext facesContext = FacesContext.getCurrentInstance(); 
              ExternalContext externalContext = facesContext.getExternalContext(); 
              HttpServletResponse response = (HttpServletResponse) externalContext.getResponse(); 
             try  
             //It is a simple POJO , it will return the pdf content 
                     PDF  pdf =  new PDF(); 
                 inputStream = pdf.getPDFContent(); 
                 input = new BufferedInputStream(inputStream, DEFAULT_BUFFER_SIZE); 
                 response.reset(); 
                 response.setContentType("application/pdf"); 
                 response.setHeader("Content-disposition", "inline; filename=\"" + pdf.getFileName() + "\""); 
                 output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE); 
                 byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; 
                 int length; 
                 while ((length = input.read(buffer)) > 0)  
                     output.write(buffer, 0, length); 
                 output.flush(); 
             }catch(Exception ex) 
                 ex.printStackTrace(); 
             finally { 
                output.close();  
                input.close();  
              facesContext.responseComplete(); 
         }  Here is my view JSF
    <h:commandLink  value="Show PDF" action="#{myBean.showPDF}" target="_blank" />  Thanks & regards,
    S

    The problem is
    ul.MenuBarHorizontal li
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        position: relative;
        text-align: left;
        cursor: pointer;
        width: 7em;
       float: right;
    Change the value back to left.
    The menu bar will now left align itself. To fix that we will go to the container, give it a width and float it to the right as follows.
    ul.MenuBarHorizontal
        margin: 0;
        padding: 0;
        list-style-type: none;
        font-size: 100%;
        cursor: default;
        width: 42em;
        float: right;
    Gramps

  • Viewing PDF files in-browser with Firefox (17.0 as of this writing) on a Mac

    Hello there,
    since I don't remember when there has been a problem with the Adobe Reader NPAPI plug-in and Firefox. Previously, with earlier versions of Firefox and with Adobe Reader 10.x the problem was that the plug-in wasn't working properly and one got a blank page without any explanation. This led to Firefox black-listing the Adobe Reader NPAPI plug-in and having it disabled by default, if I remember correctly. Now it seems we've got the situation reversed, as if Adobe has black-listed Firefox as a browser, because when I try viewing a PDF file in-browser with the most up-to-date versions (17 and 11 for Firefox and Reader respectively), I'm getting the following error:
    Adobe Reader cannot show documents in this browser.
    We are sorry, but Adobe Reader is unable to show documents in this browser configuration.
    Please use your browser to download this file and open it in Adobe Reader or Adobe Acrobat.
    To avoid this message in the future, many browsers provide a way to turn off certain add-ons, and some are able to show this document natively.
    Please contact your browser vendor for more details.
    All's well that ends well, but unfortunately we haven't seen any solution so far. With Safari 6.x the plug-in is working fine. With Firefox it isn't. Let's see what can be done: in its last sentence the error message recommends that I contact my browser vendor for more details. The wording of the first two sentences however suggests otherwise: "Adobe Reader cannot show documents in this browser. Adobe reader is unable to show documents in this browser configuration." Thus, my question is
    What is it in this browser and/or browser configuration that doesn't suit the Adobe Reader plug-in? Is it only this newest Firefox version (17) that isn't supported or is it the Firefox browser and why? Should I be able to spoof Firefox' identity and make it seem like Safari to the plug-in, what's going to happen?

    Very frustrating, but I found the fix (on another site - can't believe with 360 views, no one here knew). In Firefox, PDFs are automatically set to open with the faulty Adobe plug-in. To change it to open with Adobe Reader, check out the instructions here:
    https://support.mozilla.org/en-US/kb/pdf-files-are-blank-and-cant-be-downloaded-mac#os=mac &browser=fx16
    Super easy!

  • Weird Pdf Download in Browser

    Hi
    i have few problems when downloading pdf to the browser in java
    and this only happen when i set Content-disposition" = "inline"
    in my jsp page i have two function
    1. click here where will popup another window and will just render the pdf on the new window
    2. submit where it will render the pdf on current window
    render pdf on the current window works okay and no problem
    but there are two problem for click here where it suppose to popup new window
    1. the new window did pop up but show blank page even though writing to the response has been completed
    2. for adobe reader 6.0 or older it will popup xxxx.FDF and show it corrupted?
    Both are happening on adobe reader 6.0
    *but if i use adobe reader 8.0/7.0 no PROBLEM at all*
    could it be adobe bug for older version?
    what could be the problem ??
    Below are my code
    {code}
    public class DownloadAction {
    public static void downloadFile(HttpServletResponse response)throws Exception {
    System.out.println("Start Download");
    File file = new File("D:/WebServicesPerformance.pdf");
    BufferedInputStream input = new BufferedInputStream(new FileInputStream(file));
    int contentLength = input.available();
    response.reset();
    response.setContentLength(contentLength);
    //response.setContentType("application/pdf");
    response.setHeader("Content-type","application/pdf");
    response.setHeader("Content-disposition", "inline; filename=\"file.pdf\"");
    BufferedOutputStream output = new BufferedOutputStream(response.getOutputStream());
    while (contentLength-- > 0) {
    output.write(input.read());
    output.flush();
    if(input!=null){
    input.close();
    }{code}
    Jsp page for new window
    {code}<%@page import="com.*"%>
    <%
    try{
    DownloadAction.downloadFile(response);
    System.out.println("FINISH");
    }catch(Exception e){
    System.out.println("EXCEPTION ");
    %>{code}
    i can see the word FINISH being printed out in the log
    main jsp
    {code}
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script language="javascript">
    function openWindow()
    var win= window.open("http://localhost:8084/WebApplication2/index11.jsp",'testr','width=720,height=600');
    win.focus();
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h2>Hello World!</h2>
    <form name="form1" action="/WebApplication2/TestController" method="post">
    <a href="javascript:openWindow()"> Click Here </a>
    <input type="hidden" name="file" value="hi"/>
    <br>
    <input
    type="submit"
    name ="mybutton"
    value="Submit"/>
    </form>
    </body>
    </html>{code}

    anyone hit this problem before?

  • Can't view PDF files in browser without disabling add-on.

    Hi,
    I have a situation where the website i'm using tries to open a PDF file on screen/in browser, but unfortunately it doesn't actually open, i just get a grey screen. The only way around this is by disabling the adobe reader add-on.
    The only problem is, another piece of software that we use requires this adobe reader enabled to work, so I need a solution.
    Can anyone advise? I'm currently on Internet Explorer 9.

    Hi Gary,
    Yes, you can by using the plugin from Schubert.
    Plugin PDF Safari
    After the installation open your PDF Application en deselect in the Internet section >Show PDF in browser<
    Good luck ...
    Dimaxum

  • Open pdf in popup browser window

    Hello
    I want to show a pdf file which is stored in a blob column in the database in a popup browser window.
    I'm using apex 4.1 (soon 4.2) ans an 11gR2 database.
    I searched the OTN forum and found a lot of threads about this issue but I do not see a solution that works fine for me.
    Most inspiration from this post:
    Show PDF ....
    There is an example application from Kumar:
    http://apex.oracle.com/pls/apex/f?p=52018
    worspace: kumar2003
    username: test_user
    password: test
    application: 52018
    Test1 is the solution I want to create.
    I tried :
    Content-Disposition:  inline;and that works almost fine. Only the pdf is not in a popup browser window.
    Patrick Wolf suggests:
    <a href="your_download_link" target="_blank">PDF</a>But I do not exactly know what he means.
    Any help would be appreciated.
    Regards Erik

    Hi,
    I hope I understood your question correctly, if so my suggestion may be helpful. Otherwise I think it's nearly the same what paul writes, I only made clear my proposal in a website for you, first a photo:
    and here is the link: http://www.goldschmiede-blumberg.de/pdf/adob_pdf.php.
    Note 1: "Ausgabe 9" und "ein Mausklick hier genügt" are links!!
    Note 2: " Um pdf-Dateien ...." Means: To read pdf files, you need the free Adobe Reader. The current version you can download from the Adobe website.
    Look at it's source code.
    Viel Erfolg
    Hans-G.

  • Acrobat print window crashed when try to a print the PDF opened through browser

    Hi,
    I have Acobat pro and reader installed on my machine.
    I have set the properties - Open pdf in browser. So, all the PDFs are opening in browser uses Acrobat not the reader.
    And this is way I want. It was woking fine on Windows XP.
    After Windows 7 upgrade, Print option on acrobat (pdf opened in browser), makes browser crashed. Printing window (pop up) appears but looks it is hanged. No OK, cancel buttons appears.
    If I uncheck the acrobat properties - Open pdf in browser, then it works fine. But my other applications which need acrobat in the browser start crashing.
    Is there any property/setting which is restricting print dialog box/ making browser not to respond?
    Please advise.

    Yes, I updated Acrobat through update option last week.
    Acrobat 9.5.2
    Windows 7 64 bit OS
    Adobe Reader XI
    Browser IE 10
    In print window couple of fields which get drop down automatically have blank values.
    Please let me know if you need more information. 
    Arcobat shows proper print window (pop up) if I uncheck the checkbox - Open pdf in browser. And then I open pdf in acrobat and try to print it.

Maybe you are looking for

  • Gkrellm and KDE

    I have recently been having problems with Gkrellm and KDE.  I have gkrellm set to be dockable.  However, when I move gkrellm to the right of the screen and it docks there, the KDE panel shrinks in width a little bit, and shifts to the right.  Any ide

  • I have a Gotality Heart Monitor accessory and my iPhone 4 is not reading it. I restored the phone and cleaned out the 30 pin jack and still no luck. Any suggestions without going to a apple store. Thanks

    I recieved a gotality heart monitor accessory and my iPhone doesn't read the accessory when attached to phone. The accessory works on my friends iPhone 4, so the accessory works. I restored my phone and cleaned out the 30 pin jack and still no luck.

  • Batch Export Stills Broken in FCP5?

    In FCPHD you used to be able to batch export stills by setting markers in your clip 1) Choose a clip, put in markers where you want to export 2) open the export queue window (window -> export queue) 3) drag the markers into the queue window 4) select

  • Updating Acrobat X

    Good morning, I have a question about updataing Acrobat X.  I currently have 50 installs, but only 25 are up-to-date, 10.1.4; 15 are 10.0.0; 1 is 10.1.0; 3 are 10.1.1; 4 are 10.1.2; and 2 are 10.1.3.  The Acrobat Enterprise Administration manual stat

  • Facebook display pictures don't sync

    I have just updated to both iOS 6.0 and OSX 10.8.2. The problem I have is that, when I add my Facebook account to both my Mac and iPhone and press "Update Profile Photos...", it returns "Updated 0 contacts" and my contacts are not updated. I'm not su