fop 0.93

org.apache.fop.apps
Class Fop

java.lang.Object
  extended byorg.apache.fop.apps.Fop

public class Fop
extends java.lang.Object

Primary class that activates the FOP process for embedded usage.

JAXP is the standard method of embedding FOP in Java programs. Please check our embedding page for samples (these are also available within the distribution in FOP_DIR\examples\embedding)

Methods within FOUserAgent are available to customize portions of the process. For example, a specific Renderer object can be specified, also ElementMappings which determine elements in the FO that can be processed) can be added.

At the moment, it is recommended not to reuse an instance of this class for more than one rendering run.


Constructor Summary
Fop(java.lang.String outputFormat)
          Deprecated. End-users should use FopFactory.newFop(String) instead! This constructor will become invisible with FOP 1.0.
Fop(java.lang.String outputFormat, FOUserAgent ua)
          Deprecated. End-users should use FopFactory.newFop(String, FOUserAgent) instead! This constructor will become invisible with FOP 1.0.
Fop(java.lang.String outputFormat, FOUserAgent ua, java.io.OutputStream stream)
          Deprecated. End-users should use FopFactory.newFop(String, FOUserAgent, OutputStream) instead! This constructor will become invisible with FOP 1.0.
 
Method Summary
 org.xml.sax.helpers.DefaultHandler getDefaultHandler()
          Returns the DefaultHandler object used to generate the document.
 FormattingResults getResults()
          Returns the results of the rendering process.
 FOUserAgent getUserAgent()
          Get the FOUserAgent instance for this process
static java.lang.String getVersion()
          Deprecated. Use Version.getVersion() instead! This method will be removed with FOP 1.0.
 void setOutputStream(java.io.OutputStream stream)
          Deprecated. Use one of the factory methods on FopFactory with an OutputStream parameter instead. This method will be removed with FOP 1.0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fop

public Fop(java.lang.String outputFormat,
           FOUserAgent ua,
           java.io.OutputStream stream)
    throws FOPException
Deprecated. End-users should use FopFactory.newFop(String, FOUserAgent, OutputStream) instead! This constructor will become invisible with FOP 1.0.

Constructor for use with already-created FOUserAgents. It uses MIME types to select the output format (ex. "application/pdf" for PDF).

Parameters:
outputFormat - the MIME type of the output format to use (ex. "application/pdf").
ua - FOUserAgent object
stream - the output stream
Throws:
FOPException - if setting up the DefaultHandler fails

Fop

public Fop(java.lang.String outputFormat,
           FOUserAgent ua)
    throws FOPException
Deprecated. End-users should use FopFactory.newFop(String, FOUserAgent) instead! This constructor will become invisible with FOP 1.0.

Constructor for use with already-created FOUserAgents. It uses MIME types to select the output format (ex. "application/pdf" for PDF).

Parameters:
outputFormat - the MIME type of the output format to use (ex. "application/pdf").
ua - FOUserAgent object
Throws:
FOPException - if setting up the DefaultHandler fails

Fop

public Fop(java.lang.String outputFormat)
Deprecated. End-users should use FopFactory.newFop(String) instead! This constructor will become invisible with FOP 1.0.

Constructor for FOP with a default FOUserAgent. It uses MIME types to select the output format (ex. "application/pdf" for PDF).

Parameters:
outputFormat - the MIME type of the output format to use (ex. "application/pdf").
Method Detail

getUserAgent

public FOUserAgent getUserAgent()
Get the FOUserAgent instance for this process

Returns:
the user agent

setOutputStream

public void setOutputStream(java.io.OutputStream stream)
Deprecated. Use one of the factory methods on FopFactory with an OutputStream parameter instead. This method will be removed with FOP 1.0.

Set the OutputStream to use to output the result of the Render (if applicable)

Parameters:
stream - the stream to output the result of rendering to

getDefaultHandler

public org.xml.sax.helpers.DefaultHandler getDefaultHandler()
                                                     throws FOPException
Returns the DefaultHandler object used to generate the document. Checking for null and the exception is only for the deprecated constructor.

Returns:
the SAX DefaultHandler for handling the SAX events.
Throws:
FOPException - if setting up the DefaultHandler fails

getResults

public FormattingResults getResults()
Returns the results of the rendering process. Information includes the total number of pages generated and the number of pages per page-sequence. Call this method only after the rendering process is finished. Note that the results are only available for output formats which make use of FOP's layout engine (PDF, PS, etc.).

Returns:
the results of the rendering process, or null for flow-oriented output formats like RTF and MIF.

getVersion

public static java.lang.String getVersion()
Deprecated. Use Version.getVersion() instead! This method will be removed with FOP 1.0.

Get the version of FOP

Returns:
the version string

fop 0.93

Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.