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

4036Re: [XSL-FO] urgent help with pdf rendering

Expand Messages
  • Chris Bowditch
    Sep 1, 2003
    • 0 Attachment
      >From: "soken78" <soken78@...>
      >Hello I have been able to successfully render a pdf from a specified
      >xsl and xml file.

      What XSL-FO formatter are you using?

      >However only the static information within the pdf
      >is shown. I am suspicious that maybe the xml is empty. Can someone
      >please verfiy that the following code is correct, specifically the
      >line: byte[] xmlSrc = xml.getBytes();. I think that this might be
      >causing the problem. If it is how can I convert the string to a
      >byte[] and then convert that byte[] to a StreamSource?

      To convert string to byte array use the getBytes() method on String.
      StreamSource takes InputStream as argument to its contructor, so create a
      ByteArrayInputStream based on your byte array, e.g.

      new StreamSource(new ByteArrayInputStream(yourString.getBytes()));

      >This is quite urgent. I hope someone can help and thank you in


      I had a quick look at your code and noticed that you don't close the output
      stream in your renderFOP method. You need to close the ByteArrayOutputStream
      to ensure all data is flushed to the array.

      The problem could also be in your stylesheet, post small snippets of your
      XSL and XML files if you still have no luck.


      Use MSN Messenger to send music and pics to your friends
    • Show all 2 messages in this topic