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

Urgent - FOP Performance when using TTF font!

Expand Messages
  • andycheungkwokshun <andycheungkwokshun@y
    Dear all, I m using fop-0.20.4rc and I can successfully using xsl + xml in servlet to generate a pdf file with chinese characters. However, I found that there
    Message 1 of 7 , Jan 8, 2003
    • 0 Attachment
      Dear all,

      I'm using fop-0.20.4rc and I can successfully using xsl + xml in
      servlet to generate a pdf file with chinese characters. However, I
      found that there is a performance issue on executing the following:

      driver.render(input.getParser(), input.getInputSource());

      It takes more than 5 seconds with 100% CPU usage to finish the above
      statement. The performance will be greatly improved if I removed
      those blocks in using chinese font.

      As our company required to generated many pdfs with chinese fonts,
      any ideas for improving this performance issue? Many thanks for any
      recommendation and comments.

      Here is the coding for reference:

      In XSL
      <xsl:template match="text2">
      <fo:block
      font-family="Kaiu"
      break-before="page">
      The chinese characters from xml file <xsl:value-of
      select="."/>
      </fo:block>
      </xsl:template>

      In XML
      <text2>
      永 亨
      </text2>

      In Servlet
      String xmlParam = "C:\\fop-0.20.4rc\\krusty.xml";
      String xslParam = "C:\\fop-0.20.4rc\\krusty.xsl";

      XSLTInputHandler input = new XSLTInputHandler(new File(xmlParam), new
      File(xslParam));

      String userConfig = "C:\\fop-0.20.4rc\\conf\\userconfig.xml";
      Options options = new Options();

      Driver driver = new Driver();
      driver.setLogger(log);
      driver.setRenderer(Driver.RENDER_PDF);
      driver.setOutputStream(out);
      options.loadUserconfiguration(userConfig);
      driver.render(input.getParser(), input.getInputSource());
    • Roland Neilands
      ... Try 0.20.5rc, there were apparently some performance improvements. ... There is also a fop-user list, check the fop website for the archive/subscription
      Message 2 of 7 , Jan 8, 2003
      • 0 Attachment
        > I'm using fop-0.20.4rc
        Try 0.20.5rc, there were apparently some performance improvements.

        > It takes more than 5 seconds with 100% CPU usage to finish the above
        > statement. The performance will be greatly improved if I removed
        > those blocks in using chinese font.
        >
        > As our company required to generated many pdfs with chinese fonts,
        > any ideas for improving this performance issue? Many thanks for any
        > recommendation and comments.
        There is also a fop-user list, check the fop website for the
        archive/subscription details.

        Good luck,
        Roland
      • andycheungkwokshun <andycheungkwokshun@y
        Thanks Roland! I have tried to use 0.20.5c but even slower! I also search from fop-user and many other newsgroup/usergroups but no related font-related
        Message 3 of 7 , Jan 13, 2003
        • 0 Attachment
          Thanks Roland! I have tried to use 0.20.5c but even slower! I also
          search from fop-user and many other newsgroup/usergroups but no
          related font-related performance issue are raised.

          Actually, I finally found that it is a problem of creating the
          chinese font when rendering. As the generated xml file for the
          chinese is nearly 1MB, it is quite time consuming for loading xml
          file for further processing. So, I'm trying to preload that font when
          creating the Driver. Any advise or comments on this approach? Thanks
          a lot!

          --- In XSL-FO@yahoogroups.com, "Roland Neilands" <rneilands@p...>
          wrote:
          > > I'm using fop-0.20.4rc
          > Try 0.20.5rc, there were apparently some performance improvements.
          >
          > > It takes more than 5 seconds with 100% CPU usage to finish the
          above
          > > statement. The performance will be greatly improved if I removed
          > > those blocks in using chinese font.
          > >
          > > As our company required to generated many pdfs with chinese fonts,
          > > any ideas for improving this performance issue? Many thanks for
          any
          > > recommendation and comments.
          > There is also a fop-user list, check the fop website for the
          > archive/subscription details.
          >
          > Good luck,
          > Roland
        • Oleg Tkachenko
          ... Probably font metrics preloading does may help you, but that s too FOP-specific question, why don t you ask on fop-user mail list? -- Oleg Tkachenko
          Message 4 of 7 , Jan 14, 2003
          • 0 Attachment
            andycheungkwokshun wrote:

            > Actually, I finally found that it is a problem of creating the
            > chinese font when rendering. As the generated xml file for the
            > chinese is nearly 1MB, it is quite time consuming for loading xml
            > file for further processing. So, I'm trying to preload that font when
            > creating the Driver. Any advise or comments on this approach? Thanks
            > a lot!
            Probably font metrics preloading does may help you, but that's too
            FOP-specific question, why don't you ask on fop-user mail list?

            --
            Oleg Tkachenko
            eXperanto team
            Multiconn Technologies, Israel
          • gilles grandon
            hello, I use fop 0.20.5. I have a file.bat with: Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf when I double click
            Message 5 of 7 , Jan 14, 2003
            • 0 Attachment
              hello,


              I use fop 0.20.5.
              I have a file.bat with:


              Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf
              Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf

              when I double click on file.bat, only the first line of order is carried
              out. why?

              gilles
            • Oleg Tkachenko
              ... Well, who remember msdos batch file syntax nowadays? :) call Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf call Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf
              Message 6 of 7 , Jan 14, 2003
              • 0 Attachment
                gilles grandon wrote:

                > I use fop 0.20.5.
                > I have a file.bat with:
                >
                >
                > Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf
                > Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf
                >
                > when I double click on file.bat, only the first line of order is carried
                > out. why?
                Well, who remember msdos batch file syntax nowadays? :)

                call Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf
                call Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf

                --
                Oleg Tkachenko
                eXperanto team
                Multiconn Technologies, Israel
              • gilles grandon
                hello, I use fop 0.20.5. I have a file.bat with: Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf when I double click
                Message 7 of 7 , Jan 14, 2003
                • 0 Attachment
                  hello,


                  I use fop 0.20.5.
                  I have a file.bat with:


                  Fop -xsl fo.xsl -xml temp.xml -pdf temp.pdf
                  Fop -xsl fo.xsl -xml temp2.xml -pdf temp2.pdf

                  when I double click on file.bat, only the first line of order is carried
                  out. why?

                  gilles
                Your message has been successfully submitted and would be delivered to recipients shortly.