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 ?
Gilson
> ----- Mensagem original -----
> De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
> 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();
>
>