de.dante.extex.backend.documentWriter.pdf
Class PdfDocumentWriter

java.lang.Object
  extended byde.dante.extex.backend.documentWriter.pdf.PdfDocumentWriter
All Implemented Interfaces:
DocumentWriter, SingleDocumentStream

public class PdfDocumentWriter
extends java.lang.Object
implements DocumentWriter, SingleDocumentStream

Implementation of a pdf document writer.

Version:
$Revision: 1.3 $
Author:
Michael Niedermair, Rolf Niepraschk

Field Summary
static int HEIGHT_A4_BP
          height A4 in bp.
static int WIDTH_A4_BP
          width A4 in bp.
 
Constructor Summary
PdfDocumentWriter(Configuration cfg, DocumentWriterOptions options)
          Creates a new object.
 
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.
 int getPages()
           
 void setOutputStream(java.io.OutputStream outStream)
          Setter for the output stream.
 void setParameter(java.lang.String name, java.lang.String value)
          Setter for a named parameter.
 int shipout(Page p)
          This is the entry point for the document writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH_A4_BP

public static final int WIDTH_A4_BP
width A4 in bp.

See Also:
Constant Field Values

HEIGHT_A4_BP

public static final int HEIGHT_A4_BP
height A4 in bp.

See Also:
Constant Field Values
Constructor Detail

PdfDocumentWriter

public PdfDocumentWriter(Configuration cfg,
                         DocumentWriterOptions options)
Creates a new object.

Parameters:
cfg - the configuration
options - the options
Method Detail

close

public void close()
           throws DocumentWriterException
Description copied from interface: DocumentWriter
This method is invoked upon the end of the processing.

Specified by:
close in interface DocumentWriter
Throws:
DocumentWriterException
See Also:
DocumentWriter.close()

getExtension

public java.lang.String getExtension()
Description copied from interface: DocumentWriter
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.

Specified by:
getExtension in interface DocumentWriter
Returns:
the appropriate extension for file names
See Also:
DocumentWriter.getExtension()

getPages

public int getPages()
See Also:
de.dante.extex.backend.documentWriter.DocumentWriter#getPages()

setOutputStream

public void setOutputStream(java.io.OutputStream outStream)
Description copied from interface: SingleDocumentStream
Setter for the output stream.

Specified by:
setOutputStream in interface SingleDocumentStream
Parameters:
outStream - the output stream
See Also:
de.dante.extex.backend.documentWriter.DocumentWriter#setOutputStream(java.io.OutputStream)

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Description copied from interface: DocumentWriter
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.

Specified by:
setParameter in interface DocumentWriter
Parameters:
name - the name of the parameter
value - the value of the parameter
See Also:
DocumentWriter.setParameter( java.lang.String, java.lang.String)

shipout

public int shipout(Page p)
            throws DocumentWriterException
Description copied from interface: DocumentWriter
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.

Specified by:
shipout in interface DocumentWriter
Parameters:
p - the page to send
Returns:
returns the number of pages shipped
Throws:
DocumentWriterException
See Also:
de.dante.extex.backend.documentWriter.DocumentWriter#shipout( de.dante.extex.typesetter.type.NodeList)