Click or drag to resize
ApocDriver Class
ApocDriver provides the client with a single interface to invoking Apoc XSL-FO.
Inheritance Hierarchy
SystemObject
  Kettic.AspNet.Controls.Toolkit.ApocApocDriver

Namespace: Kettic.AspNet.Controls.Toolkit.Apoc
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public class ApocDriver : IDriver

The ApocDriver type exposes the following members.

Constructors
  NameDescription
Public methodApocDriver
Sets the the 'baseDir' property in the Configuration class using the value returned by Directory.GetCurrentDirectory().
Top
Methods
  NameDescription
Public methodStatic memberMake
Constructs a new ApocDriver and registers the newly created driver as the active driver.
Public methodRender(Stream, Stream)
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 methodRender(TextReader, Stream)
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 methodRender(String, Stream)
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 methodRender(String, String)
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.
Public methodRender(XmlDocument, Stream)
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.
Public methodRender(XmlReader, Stream)
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.
Top
Properties
  NameDescription
Public propertyStatic memberActiveDriver
Gets or sets the active ApocDriver.
Public propertyBaseDirectory
Gets or sets the base directory used to locate external resourcs such as images.
Public propertyCloseOnExit
Determines if the output stream should be automatically closed upon completion of the render process.
Public propertyCode exampleCredentials
Gets a reference to a CredentialCache object that manages credentials for multiple Internet resources.
Public propertyImageHandler
Gets or sets the handler that is responsible for loading the image data for external graphics.
Public propertyOptions
Options that are passed to the rendering engine.
Public propertyStatic memberProductKey
Write only property that can be used to bypass licenses.licx and set a product key directly.
Public propertyRenderer
Determines which rendering engine to use.
Public propertyTimeout
Gets or sets the time in milliseconds until an HTTP image request times out.
Top
Events
  NameDescription
Public eventCode exampleOnError
A multicast delegate. The error event Apoc publishes.
Public eventOnInfo
A multicast delegate. The info event Apoc publishes.
Public eventOnWarning
A multicast delegate. The warning event Apoc publishes.
Top
Remarks
The examples belows demonstrate several ways of invoking Apoc XSL-FO. The methodology is the same regardless of how Apoc is embedded in your system (ASP.NET, WinForm, Web Service, etc).
Examples
// This example demonstrates rendering an XSL-FO file to a PDF file.
ApocDriver driver = ApocDriver.Make();
driver.Render(
    new FileStream("readme.fo", FileMode.Open), 
    new FileStream("readme.pdf", FileMode.Create));
// This example demonstrates rendering the result of an XSLT transformation 
// into a PDF file.
ApocDriver driver = ApocDriver.Make();
driver.Render(
    XslTransformer.Transform("readme.xml", "readme.xsl"),
    new FileStream("readme.pdf", FileMode.Create));
// This example demonstrates using an XmlDocument as the source of the 
// XSL-FO tree.  The XmlDocument could easily be dynamically generated.
XmlDocument doc = new XmlDocument()
doc.Load("reader.fo");

ApocDriver driver = ApocDriver.Make();
driver.Render(doc, new FileStream("readme.pdf", FileMode.Create));
See Also