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

Creating PDF on the fly out of a JAVA-Appl.

Expand Messages
  • schubert_ingo@yahoo.de
    Hi, I want to transform XML-FO to PDF in a JAVA-Application via FOP. Could somebody tell me how I can do this. Perhaps with a small example of the
    Message 1 of 4 , Aug 2, 2001
    • 0 Attachment
      Hi,

      I want to transform XML-FO to PDF in a JAVA-Application via FOP.

      Could somebody tell me how I can do this. Perhaps with a small
      example of the JAVA-sourcecode ?
    • neuggs@concentric.net
      Greetings, Consider checking out: http://xml.apache.org/fop/embedding.html Regards, Frank.
      Message 2 of 4 , Aug 2, 2001
      • 0 Attachment
        Greetings,

        Consider checking out:

        http://xml.apache.org/fop/embedding.html

        Regards,
        Frank.

        --- In XSL-FO@y..., schubert_ingo@y... wrote:
        > Hi,
        >
        > I want to transform XML-FO to PDF in a JAVA-Application via FOP.
        >
        > Could somebody tell me how I can do this. Perhaps with a small
        > example of the JAVA-sourcecode ?
      • ultimatejerko@yahoo.com
        Actually, it s very simple. Here are the steps: 1. Create your XML Document or file (I ll give examples of the file way). 2. Instantiate an XMLReader to
        Message 3 of 4 , Aug 2, 2001
        • 0 Attachment
          Actually, it's very simple. Here are the steps:
          1. Create your XML Document or file (I'll give examples of the file
          way).
          2. Instantiate an XMLReader to parse.
          3. Instantiate a org.apache.fop.apps.Driver.

          org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver();

          4. Add element mappings and property lists as needed.

          driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");

          5. Set your renderer to PDF.

          driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
          org.apache.fop.apps.Version.getVersion());

          6. I used the XSLTransform tool to do the transformation.

          XSLTransform.transform(dummyXML, stylesheet, writer);

          7. Build your FO Tree.

          driver.buildFOTree(parser, new InputSource(reader));

          8. Call format & render.

          driver.format();
          driver.render();


          That's it. We use something similar in production today.

          Hope it helps,
          Lou

          --- In XSL-FO@y..., schubert_ingo@y... wrote:
          > Hi,
          >
          > I want to transform XML-FO to PDF in a JAVA-Application via FOP.
          >
          > Could somebody tell me how I can do this. Perhaps with a small
          > example of the JAVA-sourcecode ?
        • swathi_chilukuri
          Hi, Can you post the sample java code? Also, have you been able to do page breaks in xslt, depending on the number of rows in a table? I am new to FOP, so I
          Message 4 of 4 , Jan 11, 2002
          • 0 Attachment
            Hi,

            Can you post the sample java code?

            Also, have you been able to do page breaks in xslt, depending on the
            number of rows in a table?

            I am new to FOP, so I would appreciate some help. Thanks.

            Swathi

            --- In XSL-FO@y..., ultimatejerko@y... wrote:
            > Actually, it's very simple. Here are the steps:
            > 1. Create your XML Document or file (I'll give examples of the
            file
            > way).
            > 2. Instantiate an XMLReader to parse.
            > 3. Instantiate a org.apache.fop.apps.Driver.
            >
            > org.apache.fop.apps.Driver driver = new
            org.apache.fop.apps.Driver();
            >
            > 4. Add element mappings and property lists as needed.
            >
            >
            driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
            >
            > 5. Set your renderer to PDF.
            >
            > driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
            > org.apache.fop.apps.Version.getVersion());
            >
            > 6. I used the XSLTransform tool to do the transformation.
            >
            > XSLTransform.transform(dummyXML, stylesheet, writer);
            >
            > 7. Build your FO Tree.
            >
            > driver.buildFOTree(parser, new InputSource(reader));
            >
            > 8. Call format & render.
            >
            > driver.format();
            > driver.render();
            >
            >
            > That's it. We use something similar in production today.
            >
            > Hope it helps,
            > Lou
            >
            > --- In XSL-FO@y..., schubert_ingo@y... wrote:
            > > Hi,
            > >
            > > I want to transform XML-FO to PDF in a JAVA-Application via FOP.
            > >
            > > Could somebody tell me how I can do this. Perhaps with a small
            > > example of the JAVA-sourcecode ?
          Your message has been successfully submitted and would be delivered to recipients shortly.