Jump to content
We've recently updated our Privacy Statement, available here ×

Help:Open PDF file in Browser


sunxh

Recommended Posts

HI,

 

Open pdf file in Internet Explorer Browser

 

window.open(link,'reportWindow','xxxxx');

 

The problem is if There is Adobe Reader 7 on client,

project will pop-up a blank browser and Reader open pdf file separately.

when server run on local,pdf file can open within browser automatically..

And with Adobe Reader6,pdf file always opened within browser whatever server is local or remote.

 

I've set Adobe Reader to open file in browser in it's internet option ,but no effect

 

I want client can view pdf file within Browser

no matter which version of Adobe Reader they've installed

any suggestion?

really appreciate for ur help~~

 

Code in jsp:

JasperPrint jasperPrint = JasperFillManager.fillReport(reportFile.getPath(),parameters,conn);

 

byte[] bytes= JasperExportManager.exportReportToPdf(jasperPrint);

 

response.setContentType("application/pdf");

response.addHeader("Content-Disposition", "inline;");

response.setContentLength(bytes.length);

ServletOutputStream ouputStream = response.getOutputStream() ;

ouputStream.write(bytes, 0, bytes.length);

ouputStream.flush();

ouputStream.close();

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I've build a new server(linux AS4) to run the same project,and didn't appear such problem.

I guess may be the old server(linux AS4)'s config has changed and induce pop-up blank browses.

Is anybody know about this?

appreciate for your suggest

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...