Package org.apache.fop.apps

Examples of org.apache.fop.apps.InputHandler


                              task.getFofile().getParentFile().toURL().toExternalForm());
        } catch (Exception e) {
            task.log("Error setting base directory", Project.MSG_DEBUG);
        }

        InputHandler inputHandler = new FOInputHandler(task.getFofile());
        XMLReader parser = inputHandler.getParser();
        setParserFeatures(parser);

        FileOutputStream pdfOut = null;
        try {
            pdfOut = new FileOutputStream(task.getPdffile());
        } catch (Exception ex) {
            MessageHandler.errorln("Failed to open " + task.getPdffile());
            throw new BuildException(ex);
        }

        task.log("Using base directory: "
                 + Configuration.getValue("baseDir"), Project.MSG_DEBUG);
        task.log(task.getFofile().getName() + " -> "
                 + task.getPdffile().getName(), Project.MSG_INFO);

        try {
            Driver driver = new Driver(inputHandler.getInputSource(), pdfOut);
            driver.setRenderer(Driver.RENDER_PDF);
            driver.setXMLReader(parser);
            driver.run();
        } catch (Exception ex) {
            MessageHandler.logln("Error: " + ex.getMessage());
View Full Code Here


                     , Project.MSG_WARN);
        }
    }

    private void render(File foFile, File outFile, int renderer) throws FOPException {
        InputHandler inputHandler = new FOInputHandler(foFile);
        XMLReader parser = inputHandler.getParser();
        setParserFeatures(parser);

        FileOutputStream out = null;
        try {
            out = new FileOutputStream(outFile);
        } catch (Exception ex) {
            log.error("Failed to open " + outFile);
            throw new BuildException(ex);
        }

        task.log(foFile + " -> " + outFile, Project.MSG_INFO);

        try {
            Driver driver = new Driver(inputHandler.getInputSource(), out);
            driver.setLogger(log);
            driver.setRenderer(renderer);
            driver.setXMLReader(parser);
            driver.run();
            out.close();
View Full Code Here

        }
    }

    private void render(File foFile, File outFile,
                        int renderer) throws FOPException {
        InputHandler inputHandler = new FOInputHandler(foFile);
        XMLReader parser = inputHandler.getParser();

        OutputStream out = null;
        try {
            File dir = outFile.getParentFile();
            dir.mkdirs();
            out = new java.io.FileOutputStream(outFile);
        } catch (Exception ex) {
            throw new BuildException(ex);
        }

        if (logFiles) task.log(foFile + " -> " + outFile, Project.MSG_INFO);

        try {
            Driver driver = new Driver(inputHandler.getInputSource(), out);
            driver.setLogger(log);
            driver.setRenderer(renderer);
            if (renderer == Driver.RENDER_XML) {
                Map rendererOptions = new java.util.HashMap();
                rendererOptions.put("fineDetail", new Boolean(true));
View Full Code Here

    }

    public void run () {
  Configuration.put("basedir", task.getBasedir());

  InputHandler inputHandler = new FOInputHandler(task.getFofile());
  XMLReader parser = inputHandler.getParser();
  setParserFeatures(parser);
 
  FileOutputStream pdfOut = null;
  try {
      pdfOut = new FileOutputStream(task.getPdffile());
  }catch(Exception ex) {
      MessageHandler.errorln("Failed to open " + task.getPdffile());
      throw new BuildException(ex);
  }

  task.log("Using base directory: " + Configuration.getValue("basedir"), Project.MSG_DEBUG);
  task.log(task.getFofile().getName() + " -> " + task.getPdffile().getName(), Project.MSG_INFO);

  try {
      Driver driver = new Driver(inputHandler.getInputSource(), pdfOut);
      driver.setRenderer(Driver.RENDER_PDF);
      driver.setXMLReader(parser);
      driver.run();
  } catch (Exception ex) {
      MessageHandler.logln("Error: " + ex.getMessage());
View Full Code Here

        }
    }

    private void render(File foFile, File outFile,
                        int renderer) throws FOPException {
        InputHandler inputHandler = new FOInputHandler(foFile);
        XMLReader parser = inputHandler.getParser();
        setParserFeatures(parser);

        FileOutputStream out = null;
        try {
            out = new FileOutputStream(outFile);
        } catch (Exception ex) {
            log.error("Failed to open " + outFile);
            throw new BuildException(ex);
        }

        task.log(foFile + " -> " + outFile, Project.MSG_INFO);

        try {
            Driver driver = new Driver(inputHandler.getInputSource(), out);
            driver.setLogger(log);
            driver.setRenderer(renderer);
      if (renderer == Driver.RENDER_XML) {
    Hashtable rendererOptions = new Hashtable();
    rendererOptions.put("fineDetail", new Boolean(true));
View Full Code Here

    public void run ()
  throws FOPException
    {
  Configuration.put("basedir", task.getBasedir());

  InputHandler inputHandler = new FOInputHandler(task.getFofile());
  XMLReader parser = inputHandler.getParser();
  setParserFeatures(parser);
 
  FileOutputStream pdfOut = null;
  try {
      pdfOut = new FileOutputStream(task.getPdffile());
  }catch(Exception ex) {
      MessageHandler.errorln("Failed to open " + task.getPdffile());
      throw new BuildException(ex);
  }

  task.log("Using base directory: " + Configuration.getValue("basedir"), Project.MSG_DEBUG);
  task.log(task.getFofile().getName() + " -> " + task.getPdffile().getName(), Project.MSG_INFO);

  try {
      Driver driver = new Driver(inputHandler.getInputSource(), pdfOut);
      driver.setRenderer(Driver.RENDER_PDF);
      driver.setXMLReader(parser);
      driver.run();
  } catch (Exception ex) {
      MessageHandler.logln("Error: " + ex.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.fop.apps.InputHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.