Loading ...
Sorry, an error occurred while loading the content.

Trouble displaying PDF from JSP

Expand Messages
  • Gaywood, Mark
    Hi all I m having difficulty getting my fop generate pdf to display from my jsp. Previously this code below worked fine, but all I get now is binary rubbish.
    Message 1 of 4 , Aug 5, 2005
    • 0 Attachment
      Hi all

      I'm having difficulty getting my fop generate pdf to display from my
      jsp. Previously this code below worked fine, but all I get now is binary
      rubbish.
      The only change is that I'm embedding fonts into the pdf.
      The pdf does display when I load in directly into an adobe reader.

      <jsp-code>

      <%
      response.setContentType("application/pdf");
      response.setHeader("Pragma", "private");
      response.setHeader("Cache-Control", "private");

      DisplayPdfForm
      form=(DisplayPdfForm)request.getAttribute("displayPdfForm");
      response.getOutputStream().write(form.getPdf());
      %>

      </jsp-code>

      Thank in advance fir your support

      Mark


      This e-mail is confidential and intended solely for the use of the individual(s) to whom it is addressed. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, copying of , or any action taken in reliance upon, it is strictly prohibited and may be illegal.


      [Non-text portions of this message have been removed]
    • J.Pietschmann
      ... What browser are you using? What does binary rubbish actually mean? Is it shown in a browser window, in an acrobat reader window embedded in the browser,
      Message 2 of 4 , Aug 5, 2005
      • 0 Attachment
        Gaywood, Mark wrote:
        > I'm having difficulty getting my fop generate pdf to display from my
        > jsp. Previously this code below worked fine, but all I get now is binary
        > rubbish.

        What browser are you using?
        What does "binary rubbish" actually mean? Is it shown in a browser
        window, in an acrobat reader window embedded in the browser, or
        somehow otherwise?

        > <%
        > response.setContentType("application/pdf");
        > response.setHeader("Pragma", "private");
        > response.setHeader("Cache-Control", "private");
        ...
        > response.getOutputStream().write(form.getPdf());

        Did you set the content-length header correctly? Does the URL
        for this page end in .pdf?

        J.Pietschmann
      • Gaywood, Mark
        ... IExplorer and FireFox ... The sort of information you get if you open a PDF in textPad. ... window, in an acrobat reader window embedded in the browser, or
        Message 3 of 4 , Aug 8, 2005
        • 0 Attachment
          >What browser are you using?
          IExplorer and FireFox

          >What does "binary rubbish" actually mean?
          The sort of information you get if you open a PDF in textPad.

          >Is it shown in a browser
          window, in an acrobat reader window embedded in the browser, or
          somehow otherwise?
          It appears that these documents are not loading the acrobat toolbar into
          the browser.
          Also we are streaming the PDF through a ByteArray, so I'm guessing the
          extension is in effect hidden.

          >Did you set the content-length header correctly? Does the URL
          for this page end in .PDF?
          Yes

          The system we have implemented has been working for the last two years,
          the only thing we have changes is that we are now embedding fonts into
          the PDF via the definitions in the userconfig.xml

          Due to delivery constraints we've opted from loading the document via a
          served. If there is anything else you can suggest I would be most
          grateful


          Mark Gaywood

          -----Original Message-----
          From: XSL-FO@yahoogroups.com [mailto:XSL-FO@yahoogroups.com] On
          Behalf Of J.Pietschmann
          Sent: Friday, August 05, 2005 11:33 PM
          To: XSL-FO@yahoogroups.com
          Subject: Re: [XSL-FO] Trouble displaying PDF from JSP


          Gaywood, Mark wrote:
          > I'm having difficulty getting my fop generate pdf to display
          from my
          > jsp. Previously this code below worked fine, but all I get now
          is binary
          > rubbish.

          What browser are you using?
          What does "binary rubbish" actually mean? Is it shown in a
          browser
          window, in an acrobat reader window embedded in the browser, or
          somehow otherwise?

          > <%
          > response.setContentType("application/pdf");
          > response.setHeader("Pragma", "private");
          > response.setHeader("Cache-Control", "private");
          ...
          > response.getOutputStream().write(form.getPdf());

          Did you set the content-length header correctly? Does the URL
          for this page end in .pdf?

          J.Pietschmann


          ________________________________

          YAHOO! GROUPS LINKS



          * Visit your group "XSL-FO
          <http://groups.yahoo.com/group/XSL-FO> " on the web.

          * To unsubscribe from this group, send an email to:
          XSL-FO-unsubscribe@yahoogroups.com
          <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

          * Your use of Yahoo! Groups is subject to the Yahoo!
          Terms of Service <http://docs.yahoo.com/info/terms/> .


          ________________________________




          This e-mail is confidential and intended solely for the use of the individual(s) to whom it is addressed. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, copying of , or any action taken in reliance upon, it is strictly prohibited and may be illegal.


          [Non-text portions of this message have been removed]
        • Christian Duschl
          Do you have linebreaks or blanks in your pdf ? ... From: XSL-FO@yahoogroups.com [mailto:XSL-FO@yahoogroups.com] On Behalf Of Gaywood, Mark Sent: Montag, 8.
          Message 4 of 4 , Aug 8, 2005
          • 0 Attachment
            Do you have linebreaks or blanks in your pdf ?

            -----Original Message-----
            From: XSL-FO@yahoogroups.com [mailto:XSL-FO@yahoogroups.com] On Behalf Of
            Gaywood, Mark
            Sent: Montag, 8. August 2005 12:13
            To: XSL-FO@yahoogroups.com
            Subject: RE: [XSL-FO] Trouble displaying PDF from JSP

            >What browser are you using?
            IExplorer and FireFox

            >What does "binary rubbish" actually mean?
            The sort of information you get if you open a PDF in textPad.

            >Is it shown in a browser
            window, in an acrobat reader window embedded in the browser, or
            somehow otherwise?
            It appears that these documents are not loading the acrobat toolbar into
            the browser.
            Also we are streaming the PDF through a ByteArray, so I'm guessing the
            extension is in effect hidden.

            >Did you set the content-length header correctly? Does the URL
            for this page end in .PDF?
            Yes

            The system we have implemented has been working for the last two years,
            the only thing we have changes is that we are now embedding fonts into
            the PDF via the definitions in the userconfig.xml

            Due to delivery constraints we've opted from loading the document via a
            served. If there is anything else you can suggest I would be most
            grateful


            Mark Gaywood

            -----Original Message-----
            From: XSL-FO@yahoogroups.com [mailto:XSL-FO@yahoogroups.com] On
            Behalf Of J.Pietschmann
            Sent: Friday, August 05, 2005 11:33 PM
            To: XSL-FO@yahoogroups.com
            Subject: Re: [XSL-FO] Trouble displaying PDF from JSP


            Gaywood, Mark wrote:
            > I'm having difficulty getting my fop generate pdf to display
            from my
            > jsp. Previously this code below worked fine, but all I get now
            is binary
            > rubbish.

            What browser are you using?
            What does "binary rubbish" actually mean? Is it shown in a
            browser
            window, in an acrobat reader window embedded in the browser, or
            somehow otherwise?

            > <%
            > response.setContentType("application/pdf");
            > response.setHeader("Pragma", "private");
            > response.setHeader("Cache-Control", "private");
            ...
            > response.getOutputStream().write(form.getPdf());

            Did you set the content-length header correctly? Does the URL
            for this page end in .pdf?

            J.Pietschmann


            ________________________________

            YAHOO! GROUPS LINKS



            * Visit your group "XSL-FO
            <http://groups.yahoo.com/group/XSL-FO> " on the web.

            * To unsubscribe from this group, send an email to:
            XSL-FO-unsubscribe@yahoogroups.com
            <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

            * Your use of Yahoo! Groups is subject to the Yahoo!
            Terms of Service <http://docs.yahoo.com/info/terms/> .


            ________________________________




            This e-mail is confidential and intended solely for the use of the
            individual(s) to whom it is addressed. If you are not the intended
            recipient, be advised that you have received this e-mail in error and that
            any use, dissemination, forwarding, printing, copying of , or any action
            taken in reliance upon, it is strictly prohibited and may be illegal.


            [Non-text portions of this message have been removed]




            Yahoo! Groups Links
          Your message has been successfully submitted and would be delivered to recipients shortly.