C# Class Fonet.FonetDriver

FonetDriver provides the client with a single interface to invoking FO.NET.
The examples belows demonstrate several ways of invoking FO.NET. The methodology is the same regardless of how FO.NET is embedded in your system (ASP.NET, WinForm, Web Service, etc).
Inheritance: IDisposable
Afficher le fichier Open project: Mimeo/Fo.Net Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void
FonetDriver ( ) : System

Sets the the 'baseDir' property in the Configuration class using the value returned by Directory.GetCurrentDirectory(). Sets the default timeout to 100 seconds.

Make ( ) : FonetDriver

Constructs a new FonetDriver and registers the newly created driver as the active driver.

Render ( Stream inputStream, Stream outputStream ) : void

Executes the conversion reading the source tree from the input stream, converting it to a format dictated by the render and writing it to the supplied output stream.

Render ( TextReader inputReader, Stream outputStream ) : void

Executes the conversion reading the source tree from the input reader, converting it to a format dictated by the renderer and writing it to the supplied output stream.

Render ( XmlDocument doc, Stream outputStream ) : void

Executes the conversion reading the source tree from the supplied XmlDocument, converting it to a format dictated by the renderer and writing it to the supplied output stream.

Any exceptions that occur during the render process are arranged into three categories: information, warning and error. You may intercept any or all of theses exceptional states by registering an event listener. See FonetDriver.OnError for an example of registering an event listener. If there are no registered listeners, the exceptions are dumped to standard out - except for the error event which is wrapped in a SystemException.

Render ( XmlReader inputReader, Stream outputStream ) : void

Executes the conversion reading the source tree from the input reader, converting it to a format dictated by the render and writing it to the supplied output stream.

The evaluation copy of this class will output an evaluation banner to standard out

Render ( string inputFile, Stream outputStream ) : void

Executes the conversion reading the source tree from the file inputFile, converting it to a format dictated by the renderer and writing it to the supplied output stream.

Render ( string inputFile, string outputFile ) : void

Executes the conversion reading the source tree from the file inputFile, converting it to a format dictated by the renderer and writing it to the file identified by outputFile.

If the file outputFile does not exist, it will created otherwise it will be overwritten. Creating a file may generate a variety of exceptions. See FileStream for a complete list.

Private Methods

Méthode Description
CreateXmlTextReader ( Stream inputStream ) : XmlReader

Utility method that creates an System.Xml.XmlTextReader for the supplied file

The returned System.Xml.XmlReader interprets all whitespace

CreateXmlTextReader ( TextReader inputReader ) : XmlReader

Utility method that creates an System.Xml.XmlTextReader for the supplied file

The returned System.Xml.XmlReader interprets all whitespace

CreateXmlTextReader ( string inputFile ) : XmlReader

Utility method that creates an System.Xml.XmlTextReader for the supplied file

The returned System.Xml.XmlReader interprets all whitespace

FireFonetError ( string message ) : void

Sends an 'error' event to all registered listeners.

If there are no listeners, a SystemException is thrown immediately halting execution

FireFonetInfo ( string message ) : void

Sends an 'info' event to all registered lisetners

If there are no listeners, message is written out to the console instead

FireFonetWarning ( string message ) : void

Sends a 'warning' event to all registered listeners

If there are no listeners, message is written out to the console instead

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

FonetDriver() public méthode

Sets the the 'baseDir' property in the Configuration class using the value returned by Directory.GetCurrentDirectory(). Sets the default timeout to 100 seconds.
public FonetDriver ( ) : System
Résultat System

Make() public static méthode

Constructs a new FonetDriver and registers the newly created driver as the active driver.
public static Make ( ) : FonetDriver
Résultat FonetDriver

Render() public méthode

Executes the conversion reading the source tree from the input stream, converting it to a format dictated by the render and writing it to the supplied output stream.
public Render ( Stream inputStream, Stream outputStream ) : void
inputStream Stream Any subclass of the Stream class, e.g. FileStream
outputStream Stream Any subclass of the Stream class, e.g. FileStream
Résultat void

Render() public méthode

Executes the conversion reading the source tree from the input reader, converting it to a format dictated by the renderer and writing it to the supplied output stream.
public Render ( TextReader inputReader, Stream outputStream ) : void
inputReader System.IO.TextReader A character orientated stream
outputStream Stream Any subclass of the Stream class
Résultat void

Render() public méthode

Executes the conversion reading the source tree from the supplied XmlDocument, converting it to a format dictated by the renderer and writing it to the supplied output stream.
Any exceptions that occur during the render process are arranged into three categories: information, warning and error. You may intercept any or all of theses exceptional states by registering an event listener. See FonetDriver.OnError for an example of registering an event listener. If there are no registered listeners, the exceptions are dumped to standard out - except for the error event which is wrapped in a SystemException.
public Render ( XmlDocument doc, Stream outputStream ) : void
doc System.Xml.XmlDocument /// An in-memory representation of an XML document (DOM). ///
outputStream Stream /// Any subclass of the Stream class. ///
Résultat void

Render() public méthode

Executes the conversion reading the source tree from the input reader, converting it to a format dictated by the render and writing it to the supplied output stream.
The evaluation copy of this class will output an evaluation banner to standard out
public Render ( XmlReader inputReader, Stream outputStream ) : void
inputReader XmlReader /// Reader that provides fast, non-cached, forward-only access /// to XML data ///
outputStream Stream /// Any subclass of the Stream class, e.g. FileStream ///
Résultat void

Render() public méthode

Executes the conversion reading the source tree from the file inputFile, converting it to a format dictated by the renderer and writing it to the supplied output stream.
public Render ( string inputFile, Stream outputStream ) : void
inputFile string Path to an XSL-FO file
outputStream Stream /// Any subclass of the Stream class, e.g. FileStream ///
Résultat void

Render() public méthode

Executes the conversion reading the source tree from the file inputFile, converting it to a format dictated by the renderer and writing it to the file identified by outputFile.
If the file outputFile does not exist, it will created otherwise it will be overwritten. Creating a file may generate a variety of exceptions. See FileStream for a complete list.
public Render ( string inputFile, string outputFile ) : void
inputFile string Path to an XSL-FO file
outputFile string Path to a file
Résultat void