2001 JI Open Discussion Posted August 15, 2006 Share Posted August 15, 2006 By: mandava - lakshmipmandava pdf file is not opening in netscape 2002-07-18 07:31when i am writing pdf file using using below code in JSP file byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(),parameters,con); // JasperRunManager.runReportToPdfFile(reportFile.getPath(),parameters,con); // System.out.println("apth is : " +application.getRealPath("/SADI.jrprint")); // JasperPrintManager.printReport("SADI.jrprint", true); response.setContentType("application/pdf"); response.setContentLength(bytes.length); ServletOutputStream ouputStream = response.getOutputStream(); ouputStream.write(bytes, 0, bytes.length); ouputStream.flush(); ouputStream.close(); In netscape the pdf file is not opening, the stream of data is writing to the browser. The browser is saying that the document is damaged or corrupted. how can i overcome this problem. By: Bart Cassady - bartong RE: pdf file is not opening in netscape 2002-07-19 07:41Don't close the output stream. The servlet container takes care of opening and closing it for you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now