de.dante.extex.backend.documentWriter
Interface DocumentWriter

All Known Implementing Classes:
AbstractPostscriptWriter, DumpDocumentWriter, DviDocumentWriter, DviDocumentWriter, MultiDumpDocumentWriter, PdfDocumentWriter, PdfSinglePageDocumentWriter, RtfDocumentWriter, SVGDocumentWriter, TextDocumentWriter, XMLDocumentWriter

public interface DocumentWriter

This is the interface to the back-end of the system. The document has to be written to an output stream. Certain information can be acquired before and after the production of the output.

Version:
$Revision: 1.4 $
Author:
Gerd Neugebauer

Method Summary
 void close()
          This method is invoked upon the end of the processing.
 java.lang.String getExtension()
          Getter for the extension associated with this kind of output.
 void setParameter(java.lang.String name, java.lang.String value)
          Setter for a named parameter.
 int shipout(Page page)
          This is the entry point for the document writer.
 

Method Detail

getExtension

public java.lang.String getExtension()
Getter for the extension associated with this kind of output. For instance pdf is the expected value for PDF files and dvi is the expected value for DVI files.

Returns:
the appropriate extension for file names

shipout

public int shipout(Page page)
            throws GeneralException,
                   java.io.IOException
This is the entry point for the document writer. Here it receives a complete node list to be sent to the output writer. It can be assumed that all values for width, height, and depth of the node lists are properly filled. Thus all information should be present to place the ink on the paper.

Parameters:
page - the page to send
Returns:
returns the number of pages shipped
Throws:
GeneralException - in case of a general exception
especially
DocumentWriterException in case of an error
java.io.IOException - in case of an IO exception

close

public void close()
           throws GeneralException,
                  java.io.IOException
This method is invoked upon the end of the processing.

Throws:
GeneralException - in case of a general exception
especially
DocumentWriterException in case of an error
java.io.IOException - in case of an IO exception

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Setter for a named parameter. Parameters are a general mechanism to influence the behavior of the document writer. Any parameter not known by the document writer has to be ignored.

Parameters:
name - the name of the parameter
value - the value of the parameter