Examples of newFop()


Examples of org.apache.fop.apps.FopFactory.newFop()

       
        Transformer transformer = tFactory.newTransformer(xslt);
        transformer.setParameter("repeats", new Integer(replicatorRepeats));
       
        OutputStream out = new NullOutputStream(); //write to /dev/nul
        Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
        Result res = new SAXResult(fop.getDefaultHandler());
       
        transformer.transform(src, res);
       
        System.out.println("Generated " + fop.getResults().getPageCount() + " pages.");
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

        }
        FopFactory fopFactory = getFactoryInstance();
        FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
        Fop fop;
        if (out != null) {
            fop = fopFactory.newFop(outputFormat, foUserAgent, out);
        } else {
            fop = fopFactory.newFop(outputFormat, foUserAgent);
        }
        return fop;
    }
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

        FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
        Fop fop;
        if (out != null) {
            fop = fopFactory.newFop(outputFormat, foUserAgent, out);
        } else {
            fop = fopFactory.newFop(outputFormat, foUserAgent);
        }
        return fop;
    }
   
    /** Returns a temporary File instance. The temporary file name starts with
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

        FopFactory fopFactory = ApacheFopWorker.getFactoryInstance();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        TransformerFactory transFactory = TransformerFactory.newInstance();

        try {
            Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
            Transformer transformer = transFactory.newTransformer();

            // set the input source (XSL-FO) and generate the PDF
            Reader reader = new StringReader(writer.toString());
            Source src = new StreamSource(reader);
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

  }
 
  protected Fop createFop(String userConfiguration, String outputFormat, OutputStream outputStream) throws FOPException {
   
    FopFactory fopFactory = getFopFactory(userConfiguration);
    return fopFactory.newFop(outputFormat != null ? outputFormat : MimeConstants.MIME_PDF, outputStream);
  }

 
  protected FopFactory getFopFactory(String userConfig) throws FOPException {
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

            ua.setBaseURL(testFile.getParentFile().toURL().toString());
            XMLRenderer atrenderer = new XMLRenderer();
            atrenderer.setUserAgent(ua);
            atrenderer.setContentHandler(athandler);
            ua.setRendererOverride(atrenderer);
            fop = effFactory.newFop(ua);
           
            SAXResult fores = new SAXResult(fop.getDefaultHandler());
            transformer.transform(src, fores);
        } finally {
            ElementListObserver.removeObserver(elCollector);
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

                throws FOPException {

        FopFactory factory = userAgent.getFactory();
        Fop fop;
        if (out != null) {
            fop = factory.newFop(outputFormat, userAgent, out);
        } else {
            fop = factory.newFop(outputFormat, userAgent);
        }

        // if base URL was not explicitly set in FOUserAgent, obtain here
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

        FopFactory factory = userAgent.getFactory();
        Fop fop;
        if (out != null) {
            fop = factory.newFop(outputFormat, userAgent, out);
        } else {
            fop = factory.newFop(outputFormat, userAgent);
        }

        // if base URL was not explicitly set in FOUserAgent, obtain here
        if (fop.getUserAgent().getBaseURL() == null && sourcefile != null) {
            String baseURL = null;
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

        "."+File.separator+"resources"+File.separator+"pdfs"+File.separator+
        "example_02.pdf")));

    try {
        // Step 3: Construct fop with desired output format
        Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);

        // Step 4: Setup JAXP using identity transformer
        TransformerFactory factory = TransformerFactory.newInstance();
        //with XSLT:
        Source xslt = new StreamSource(new File(
View Full Code Here

Examples of org.apache.fop.apps.FopFactory.newFop()

        "."+File.separator+"resources"+File.separator+"pdfs"+File.separator+
        "quotation.pdf")));

    try {
        // Step 3: Construct fop with desired output format
        Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
        StreamResult xmlOutput = new StreamResult(new StringWriter());

        // Step 4: Setup JAXP using identity transformer
        TransformerFactory factory = TransformerFactory.newInstance();
        //with XSLT:
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.