Package org.apache.fop.apps

Examples of org.apache.fop.apps.Driver.run()


            response.setContentType("application/pdf");

            Driver driver = new Driver(foFile, out);
            driver.setLogger(log);
            driver.setRenderer(Driver.RENDER_PDF);
            driver.run();

            byte[] content = out.toByteArray();
            response.setContentLength(content.length);
            response.getOutputStream().write(content);
            response.getOutputStream().flush();
View Full Code Here


            InputStream in = new java.io.FileInputStream(fo);
            try {
                driver.setInputSource(new InputSource(in));
           
                //Process FO
                driver.run();
            } finally {
                in.close();
            }
        } finally {
            out.close();
View Full Code Here

            PrinterJob pj = PrinterJob.getPrinterJob();
            PrintRenderer renderer = new PrintRenderer(pj);

            driver.setLogger (log);
            driver.setRenderer(renderer);
            driver.run();

            reportOK (response);
        } catch (Exception ex) {
            throw new ServletException(ex);
        }
View Full Code Here

            response.setContentType("application/pdf");

            Driver driver = new Driver(foFile, out);
            driver.setLogger(log);
            driver.setRenderer(Driver.RENDER_PDF);
            driver.run();

            byte[] content = out.toByteArray();
            response.setContentLength(content.length);
            response.getOutputStream().write(content);
            response.getOutputStream().flush();
View Full Code Here

      // instanciando o driver FOP para fazer a renderiza��o do documento
            Driver driver = new Driver(foInput, outPdf);
             // setando o tipo da renderiza��o a ser aplicada (PDF)
            driver.setRenderer(Driver.RENDER_PDF);           
         
            driver.run();

            byte[] content = outPdf.toByteArray();
           
            if(SAIDA_DOWNLOAD.equals(this.getSaida()) || SAIDA_DOWNLOAD_E_GRAVAR.equals(this.getSaida())) {
              response.setContentLength(content.length);
View Full Code Here

    Hashtable rendererOptions = new Hashtable();
    rendererOptions.put("fineDetail", new Boolean(true));
    driver.getRenderer().setOptions(rendererOptions);
      }
            driver.setXMLReader(parser);
            driver.run();
            out.close();
        } catch (Exception ex) {
            log.error("Couldn't render file: " + ex.getMessage());
            throw new BuildException(ex);
        }
View Full Code Here

//      rendererOptions.put("ownerPassword", "mypassword");
//      rendererOptions.put("allowCopyContent", "FALSE");
//      rendererOptions.put("allowEditContent", "FALSE");
//      rendererOptions.put("allowPrint", "FALSE");
//      driver.getRenderer().setOptions(rendererOptions);
      driver.run();
      outputStream.flush();
      outputStream.close();
    } catch (Exception e) {
      LOG.error("", e);
      throw new FacesException(e);
View Full Code Here

  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());
      throw new BuildException(ex);
  }
  logger.die();
View Full Code Here

            response.setContentType("application/pdf");

            Driver driver = new Driver(foFile, out);
            driver.setLogger(log);
            driver.setRenderer(Driver.RENDER_PDF);
            driver.run();

            byte[] content = out.toByteArray();
            response.setContentLength(content.length);
            response.getOutputStream().write(content);
            response.getOutputStream().flush();
View Full Code Here

        // ByteArrayOutputStream out = new ByteArrayOutputStream();
        driver.setOutputStream(response.getOutputStream());

        if (log4j.isDebugEnabled())
          log4j.debug("driver.run()");
        driver.run();
        /*
         * log4j.info("Beginning of out.toByteArray()"); byte[] content = out.toByteArray();
         * log4j.info("Beginning of response.setContentLength");
         * response.setContentLength(content.length);log4j.info(
         * "Beginning of response.getOutputStream().write(content)");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.