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

how to set fop in quiet mode

Expand Messages
  • Ben Abdallah
    i have embedded fop in a java project and i don t knoww how to let it work in quiet mode, any one know how?
    Message 1 of 3 , May 25 9:22 AM
    • 0 Attachment
      i have embedded fop in a java project and i don't knoww how to let
      it work in quiet mode, any one know how?
    • J.Pietschmann
      ... Use a null logger, write one yourself if necesary (shouldn t be hard). See http://xml.apache.org/fop/embedding.html#basic-logging J.Pietschmann
      Message 2 of 3 , May 25 2:13 PM
      • 0 Attachment
        Ben Abdallah wrote:

        > i have embedded fop in a java project and i don't knoww how to let
        > it work in quiet mode, any one know how?

        Use a null logger, write one yourself if necesary (shouldn't be
        hard). See
        http://xml.apache.org/fop/embedding.html#basic-logging

        J.Pietschmann
      • tlange051264
        Hi, this is really simple. Just initialize the new ConsoleLogger with ConsoleLogger.DISABLED or ERROR or FATAL. Depends on what messages you want to get. The
        Message 3 of 3 , Jun 14, 2004
        • 0 Attachment
          Hi,

          this is really simple. Just initialize the new ConsoleLogger with
          ConsoleLogger.DISABLED or ERROR or FATAL. Depends on what messages you
          want to get.
          The example below converts a DOM into a PDF-file without writing it to
          XML before, using the ConsoleLogger-Options.

          public static void convertDom2PdfFile(org.jdom.Document doc,
          String xsltFile, String pdfFile) throws Exception{
          Driver driver = new Driver();

          //Setup logger
          //Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
          Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
          driver.setLogger(logger);
          MessageHandler.setScreenLogger(logger);

          //Setup Renderer (output format)
          driver.setRenderer(Driver.RENDER_PDF);

          //Setup output
          OutputStream out = new java.io.FileOutputStream(pdfFile);

          try {
          driver.setOutputStream(out);

          //Setup XSLT
          TransformerFactory factory = TransformerFactory.
          newInstance();
          Transformer transformer = factory.newTransformer(new
          StreamSource(xsltFile));

          //Setup input for XSLT transformation
          JDOMSource in = new JDOMSource(doc);

          //Resulting SAX events (the generated FO) must be piped
          through to FOP
          Result res = new SAXResult(driver.getContentHandler());

          //Start XSLT transformation and FOP processing
          transformer.transform(in, res);
          }catch (Exception e){
          VmtEnv.writeSystemOut("Exception in DomConverter.
          convertDom2PdfStream:" + e.getMessage());
          out.close();
          throw e;
          } finally {
          out.close();
          }
          }

          Bye Torsten

          --- In XSL-FO@yahoogroups.com, "Ben Abdallah" <mourad.benabdallah@t...
          > wrote:
          > i have embedded fop in a java project and i don't knoww how to let
          > it work in quiet mode, any one know how?
        Your message has been successfully submitted and would be delivered to recipients shortly.