-----Original Message-----
From: Gilson Nascimento Del Rei [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 04, 2002 6:21 AM
Subject: RES: How to show PDF file in jsp page ?

I newbie question...
Why we have that read the pdf file ? Doesn't is a simple link sufficient for
execute it ? I mean isn't it a browser work ?

> ----- Mensagem original -----
> Enviada em:           segunda-feira, 4 de novembro de 2002 10:10
> Para:         [EMAIL PROTECTED]
> Assunto:              Re: How to show PDF file in jsp page ?
> Thanks to all, this code works ...
>             File inputFile = new File(pdfFile);
>             FileReader fr = new FileReader(inputFile);
>             ByteArrayOutputStream baos = new ByteArrayOutputStream();
>             int ch;
>             while((ch = fr.read()) != -1) {
>             baos.write(ch);
>             }
>             byte[] content = baos.toByteArray();
>             response.setContentType("application/pdf");
>             response.setContentLength(content.length);
>             response.getOutputStream().write(content);
>             response.getOutputStream().flush();
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

Reply via email to