Package de.dante.extex.backend.documentWriter

This package contains the backends of ExTeX which are responsible for writing the constructed pages to an appropriate file.

See:
          Description

Interface Summary
DocumentWriter This is the interface to the back-end of the system.
DocumentWriterOptions This interface describes the possibilities of the DocumentWriter to access its options.
MultipleDocumentStream This interface describes the ability of a class to produce multiple output documents.
PdftexSupport This interface describes the methods needed for pdfTeX support to make use of the special features of PDF.
SingleDocumentStream This interface describes the ability of a class to produce a single output document.
 

Class Summary
DocumentWriterFactory This is the factory to provide an instance of a document writer.
 

Package de.dante.extex.backend.documentWriter Description

This package contains the backends of ExTeX which are responsible for writing the constructed pages to an appropriate file. For instance a PDF writer and a PostScript writer are located in a sub-package.

Writing a DocumentWriter

To write a document writer you start to create a class which implements the interface DocumentWriter. This interface describes the ability to receive some nodes for processing. This is usually not enough. In addition it is necessary to send the result to some destination. This is accomplished by the interfaces SingleDocumentStream and MultipleDocumentStream.

Output Streams

The decoupling of the actual output stream and the writing of the document is necessary to relief the document writer from the task and concentrate the same routine for each document writer in one place. On the other side with this approach it is possible to transparently add some processing before or after the document writer. It would also be possible not only to direct the output to some file but send it to a display immediately.

The interface SingleDocumentStream is used by those document writers which send the output to a single destination. At startup the method setOutputStream() is invoked and the output stream is passed to the document writer. As an example consider a classical dvi document writer which tries to produce one output file.

The interface MultipleDocumentStream is used by those document writers which send the output to several destinations. As an example consider an EPS writer which produces one file per page. Here the method setOutputStreamFactory() is invoked at startup and a factory is passed to the document writer which can be used to acquire the next output stream. In fact MultipleDocumentStream can also be used in the case of a single output stream but the SingleDocumentStream is a little bit easier to use.

Localization

If the instantiated class implements the interface Localizable then the associated method is used to pass on the localizer to the new instance. The localizer is acquired from the LocalizerFactory with the name of the class as key.

Configuration

The document writer can implement the interface Configurable. In this case the configuration object is passed to the document writer at startup.

The document writer can implement the interface PropertyConfigurable. In this case the properties with the user's settings are passed to the document writer at startup.

Logging

The document writer can implement the interface LogEnabled. In this case the logger is passed to the document writer at startup. It can be used to send some informative or debugging messages to the log file.

Color

The document writer can implement the interface ColorAware. In this case a color converter is passed to the document writer.

Resource Access

The document writer can implement the interface ResoureConsumer. In this case a resource finder is passed to the document writer.