Previous | Next | (P-PDF) JavaScript
Topic: Problem Web PDF
Conf: (P-PDF) JavaScript, Msg: 28333
From: gberetti
Date: 10/9/2001 10:47 PM
Dear Sirs,
I am trying to sending a PDF document from a
servlet, but I have some problem.
IE does not display the page if this file is smaller than 7/8 Kb; only if I push "refresh" button, the IE
displays the page.
But, if PDF document is greater than 7/8Kb, IE always display the page(s) correctly.
Using Netscape 4.75, servlet works very well...
Do you know where is the bug? IE bug? Have you got an idea?
Example Code:
ServletOutputStream outs = response.getOutputStream();
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "inline; filename=generated.pdf");
File f = new File("C:\\Programmi\\j2sdkee1.3\\public_html\\"+"temp.pdf");
InputStream in = new FileInputStream(f);
int bit=256;
while ((bit) >= 0) {
bit = in.read();
outs.write(bit);
}
in.close();
outs.flush();
outs.close();
Thank you in advance !!!
Gabriele