unable to open PDF file in IE using java if I use Acrobat Reader 6.0

Hi, on clicking a hyperlink I need to read a pdf file from a server and I need show that document in a window, for that I have written the following code in a JSP page, it is working fine with Acrobat Reader 5.0, but it is showing empty screen if I use Acrobat Reader 6.0, I am providing my code below.

               javax.servlet.ServletOutputStream Pout = response.getOutputStream();
      response.setContentType("application/pdf");
      response.setHeader("Content-disposition", "inline; filename=" + "ClientStatement.pdf");
      
      java.io.FileInputStream fileInputStream = null;      
      java.io.BufferedInputStream bufferedInputStream = null;      
      ServletContext objServContext = getServletContext();
                String strDirectoryName =  objServContext.getInitParameter("ClientStatementsPath").toString();
      fileInputStream = new java.io.FileInputStream(strDirectoryName + strFilePath);
      bufferedInputStream = new java.io.BufferedInputStream(fileInputStream);      
      byte[] bytes = new byte[bufferedInputStream.available()];
      response.setContentLength(bytes.length);      
      bufferedInputStream.read(bytes,0,bytes.length);
      Pout.write(bytes);
      Pout.flush();
      Pout.close();
      bufferedInputStream.close();

it is urgent, pls provide the solution.

Thanks in advance.
Kamesh
Kamesh_ThatikondaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
Are you sure it displays the entire file with 5.0?
0
Kamesh_ThatikondaAuthor Commented:
ya, I'm sure, and I hosted this application on my machine, and I'm using Apache tomcat web server, then I tested it from two client machines, one is having Acrobat Reader 5.0, and another one with Acrobat Reader 6.0; it is opening with 5.0, but not with 6.0, I am not able to understand why it is behaving like this.

regards
Kamesh.
0
lhankinsCommented:
so I guess you want to display the PDF In the acrobat plugin without popuping up the "open or save as dialog"...?   If this is the case, remove the following and it should work :

     response.setHeader("Content-disposition", "inline; filename=" + "ClientStatement.pdf");

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

lhankinsCommented:
for what its worth, I'm doing something similar in one of my applications, if I have this line, I get a dialog when downloading the PDF (prompting the user to open or save the file) :

     response.setHeader("Content-disposition", "inline; filename=" + "ClientStatement.pdf");

If I leave this off, it just transparently opens the PDF in the Acrobat PDF Plugin inside of the current IE window.

0
CodingExpertsCommented:
Try to reinstall Acrobat Reader 6.0, I guess it should solve the problem..

-CE
0
KuldeepchaturvediCommented:
I remember that I have faced this problem... There are some settings in 6.0 that you have to do.. unfortunately I can not recall them.. but they were on edit-->preference-->Options tab and has to do something with plug ins...
I will try to find those settings and will let you know if I find them..
0
CodingExpertsCommented:
Well you can go to menu edit->preferences->Internet and make sure Display PDF in browser is enabled.

-CE
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Components

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.