Title: Viewing PDF's with IE 5.5

Hi everybody,

I�m generating PDF's by servlets. It works fine with IE 5.0 but when I use IE 5.5 it shows a placeholder icon into a blank page. I think that I did the things correctly but, obviously, ididn�t. My code is:

-----
public class HelloWorld extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        Document document = new Document();
        response.setContentType("application/pdf");
        ByteArrayOutputStream ba = new ByteArrayOutputStream();
        try {
            PdfWriter.getInstance(document, ba);
            document.open();
            Paragraph p1 = new Paragraph("Hello World!");
            document.add(p1);
        }
        catch(DocumentException de) {
            System.err.println(de.getMessage());
        }
        document.close();
        response.setContentLength(ba.size());
        ServletOutputStream out = response.getOutputStream();
        ba.writeTo(out);
        out.flush();
    }
}

Does anybody knows what is wrong?

Thanks in advance

Reply via email to