Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: PDF displays in Mozilla, not in IE

  1. #1
    Join Date
    Jul 2003

    Default PDF displays in Mozilla, not in IE


    I am getting my "JFreeReportServlet" percentageDemo pdf to display in Mozilla, but not in IE.

    I did set the content type:
    response.setHeader("Content-Type", "application/pdf");

    and I did set the content disposition
    response.setHeader("Content-Disposition", "inline; filename=\"first.pdf\"");

    What can I try next?

    Thanks in advance

  2. #2
    Join Date
    Mar 2003



    you could try to remove the content-disposition header completly. The Internet explorer is not willing or able to handle the official standards correctly, and may or may not accept this header. (To make things more fun, the behaviour may have changed over time, so don't expect IE4 to behave like IE5 or 6.). Removing the content-disposition header should not hurt anyone, as inlining the content is the default behaviour anyway.

    The last time it did development for browser-clients, I almost went insane and was healed by the saintly promise to never have to do that again.

    Have more fun,
    said Thomas

  3. #3
    Join Date
    Mar 2003

    Default header

    solution for this problem is
    //browser is not IE
    if (request.getParameter("browserType").equalsIgnoreCase("nonIE"))
        response.setHeader("Content-Disposition", "inline; filename=report.pdf");
    else {
    //browser is IE
        response.setHeader("Content-Disposition", "inline; filename=report.pdf");
        response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
        response.setHeader("Pragma", "Public");
    If Pragma is no-cache so IE displays only blank page. Also Cache-Control must be set like in the example. I had set
    // Set standard HTTP/1.1 no-cache headers.
    response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
    // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
    response.addHeader("Cache-Control", "post-check=0, pre-check=0");
    and I didn't work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.