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

how to use embedded FOP ?

Expand Messages
  • sukkutty_2000
    HI! I got problem while trying to use fop-0.20.4rc for converting FO file to PDF file. I got the following fragment of code in my program, which does (as far
    Message 1 of 1 , Jul 11, 2002
    • 0 Attachment
      HI!

      I got problem while trying to use fop-0.20.4rc for converting FO file
      to PDF file. I got the following fragment of code in my program,
      which does (as far as I understood) the conversion.

      ----------------------------------------------------------------------
      try{
      org.apache.avalon.framework.logger.Logger logger = new
      org.apache.avalon.framework.logger.ConsoleLogger
      (org.apache.avalon.framework.logger.ConsoleLogger.LEVEL_INFO);
      org.apache.fop.messaging.MessageHandler.setScreenLogger(logger);
      org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver();
      driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
      driver.setInputSource(new org.xml.sax.InputSource(new FileInputStream
      (inFilename)));
      driver.setOutputStream(new FileOutputStream(outFilename));
      driver.setLogger(logger);
      driver.run();

      } catch (FileNotFoundException e){
      m_log.info("Error! FileNotFoundException " + e);
      } catch (IOException e){
      m_log.info("Error! IOException " + e);
      } catch (org.apache.fop.apps.FOPException e){
      m_log.info("Error! FOPException " + e);
      }
      ----------------------------------------------------------------------


      here I get a pdf with just a header on it(of 1 kb :( ). and getting
      an error message

      [ERROR] Logger not set
      [INFO] building formatting object tree
      [INFO] [1]
      [INFO] Parsing of document complete, stopping renderer

      Can anybody help me out to understand how to go abt it now.


      thanks a lot

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