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();



Reply via email to