org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.driver
Class IBMCompatiblePrinterDriver

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.modules.output.pageable.plaintext.driver.IBMCompatiblePrinterDriver
All Implemented Interfaces:
PrinterDriver

public class IBMCompatiblePrinterDriver
extends Object
implements PrinterDriver


Nested Class Summary
static class IBMCompatiblePrinterDriver.GenericIBMPrinterSpecification
           
 
Field Summary
static int QUALITY_DEFAULT
           
static int QUALITY_DRAFT
           
static int QUALITY_ENHANCED_LETTER
           
static int QUALITY_FAST_DRAFT
           
static int QUALITY_LETTER
           
static int QUALITY_UNDEFINED
           
 
Constructor Summary
IBMCompatiblePrinterDriver(OutputStream out, float charsPerInch, float linesPerInch)
           
 
Method Summary
 void endLine(boolean overflow)
          Ends a new line.
 void endPage(boolean overflow)
          Ends the current page.
 void flush()
          Flushes the output stream.
 float getCharactersPerInch()
          Gets the default character width in CPI.
 float getLinesPerInch()
          Gets the default line height.
 int getPrintQuality()
           
 boolean isAutoLF()
           
 void printChunk(PlaintextDataChunk chunk)
          Prints a single text chunk at the given position on the current line.
 void printEmptyChunk(int count)
          Prints an empty chunk.
 void printRaw(byte[] raw)
          Prints some raw content.
 void sendLineSpacing(int lineHeight)
          Defines the line spacing for the printer.
 void setAutoLF(boolean autoLF)
           
 void setPrintQuality(int printQuality)
           
 void startLine()
          Starts a new line.
 void startPage(Paper paper, String encoding)
          Resets the printer and starts a new page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUALITY_UNDEFINED

public static final int QUALITY_UNDEFINED
See Also:
Constant Field Values

QUALITY_FAST_DRAFT

public static final int QUALITY_FAST_DRAFT
See Also:
Constant Field Values

QUALITY_DRAFT

public static final int QUALITY_DRAFT
See Also:
Constant Field Values

QUALITY_LETTER

public static final int QUALITY_LETTER
See Also:
Constant Field Values

QUALITY_ENHANCED_LETTER

public static final int QUALITY_ENHANCED_LETTER
See Also:
Constant Field Values

QUALITY_DEFAULT

public static final int QUALITY_DEFAULT
See Also:
Constant Field Values
Constructor Detail

IBMCompatiblePrinterDriver

public IBMCompatiblePrinterDriver(OutputStream out,
                                  float charsPerInch,
                                  float linesPerInch)
Method Detail

setAutoLF

public void setAutoLF(boolean autoLF)

isAutoLF

public boolean isAutoLF()

getPrintQuality

public int getPrintQuality()

setPrintQuality

public void setPrintQuality(int printQuality)

endLine

public void endLine(boolean overflow)
             throws IOException
Ends a new line.

Specified by:
endLine in interface PrinterDriver
Parameters:
overflow -
Throws:
IOException - if an IOError occures.

endPage

public void endPage(boolean overflow)
             throws IOException
Ends the current page. Should print empty lines or an FORM_FEED command.

Specified by:
endPage in interface PrinterDriver
Parameters:
overflow -
Throws:
IOException - if there was an IOError while writing the command

flush

public void flush()
           throws IOException
Flushes the output stream.

Specified by:
flush in interface PrinterDriver
Throws:
IOException - if an IOError occured.

getCharactersPerInch

public float getCharactersPerInch()
Gets the default character width in CPI.

Specified by:
getCharactersPerInch in interface PrinterDriver
Returns:
the default character width in CPI.

getLinesPerInch

public float getLinesPerInch()
Gets the default line height.

Specified by:
getLinesPerInch in interface PrinterDriver
Returns:
the default line height.

printChunk

public void printChunk(PlaintextDataChunk chunk)
                throws IOException
Prints a single text chunk at the given position on the current line. The chunk should not be printed, if an previous chunk overlays this chunk.

Specified by:
printChunk in interface PrinterDriver
Parameters:
chunk - the chunk that should be written
Throws:
IOException - if an IO error occured.

printEmptyChunk

public void printEmptyChunk(int count)
                     throws IOException
Prints an empty chunk. This is called for all undefined chunk-cells. The last defined font is used to print that empty text.

Specified by:
printEmptyChunk in interface PrinterDriver
Throws:
IOException - if an IOError occured.

printRaw

public void printRaw(byte[] raw)
              throws IOException
Prints some raw content. This content is not processed in any way, so be very carefull.

Specified by:
printRaw in interface PrinterDriver
Parameters:
raw - the content that should be printed.
Throws:
IOException

startLine

public void startLine()
               throws IOException
Starts a new line.

Specified by:
startLine in interface PrinterDriver
Throws:
IOException - if an IOError occures.

startPage

public void startPage(Paper paper,
                      String encoding)
               throws IOException
Resets the printer and starts a new page. Prints the top border lines (if necessary).

Specified by:
startPage in interface PrinterDriver
Throws:
IOException - if there was an IOError while writing the command

sendLineSpacing

public void sendLineSpacing(int lineHeight)
                     throws IOException
Defines the line spacing for the printer.

Parameters:
lineHeight - the height of a single line in points (1/72 inch).
Throws:
IOException - if an IOException occured while updating the printer state.