Skip to Content
avatar image
Former Member

Export to PDF from JSF 1.2 - Corrupt FIle


We're having a hard time with the export to PDF in a web app using JSF 1.2, the files always come out corrupt. Here are the relevant facts as I know them:

- The same reports export fine from the designer, but bad from a browser.

- CR XI R2, running through Tomcat 6 or JBoss 4+. Same problem with each.

- Browser version doesn't seem to matter.

- Example of internal content of two versions of same report. One good, generated through the Designer, one corrupt, generated through the web browser. It looks like the web version is converting PDF content to safe hex for HTML readers.



(I replaced the ending ";" with ":" so the characters do not convert prior to you seeing the underling representation.)


xu0153íu2122Ysâ8 u20ACßõ+úa ²U`t yS°'u02DCø ²Cu2020¼Qu0152u201Cõ Ç $µ% ÔÎÌzXgÖUu203AJ t´ÔêOM«m ÀꏨãQu02DC/«*u2020Í 2 y ±< ]óÅ]×"Ðulýµ)

I'm thinking it has something to do with the streaming through a web server that's corrupting the file. This may in tern be due to a JSF 1.2 compatibility issue or some setting of which I'm unaware. I would like to find a solution in XI, but am willing to move up to 2008 is need be.

Any help is appreciated.


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Sep 05, 2008 at 06:11 PM

    JSF is for text.

    If you need to stream out a binary, use a Servlet or JSP.

    JSF will try to encode the binary stream to the page character encoding.


    Ted Ueda

    Add comment
    10|10000 characters needed characters exceeded

    • I recommend:

      Show the viewer in the web page.

      Look at the HTML source.

      Do you see two <HTML> tags? One for the Crystal viewer, and another for the surrounding material?

      Export request works by postback - if you're embedding the JSF tag in surrounding material, then it'll be interpreted not as binary but as text.


      Ted Ueda