com.ibm.as400.access
Class SCS3812Writer

java.lang.Object
  extended by java.io.Writer
      extended by java.io.OutputStreamWriter
          extended by com.ibm.as400.access.SCS5256Writer
              extended by com.ibm.as400.access.SCS5224Writer
                  extended by com.ibm.as400.access.SCS5219Writer
                      extended by com.ibm.as400.access.SCS3812Writer
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class SCS3812Writer
extends SCS5219Writer

The SCS3812Writer class writes an SCS 3812 data stream to an output stream, translating characters into bytes of the specified CCSID. SCS3812Writer extends the SCS5219Writer and adds support for Bold (Emphasis), fonts, duplex printing and text orientation.

See Also:
SCS5219Writer

Field Summary
static int DUPLEX_DUPLEX
          Constant value for duplex printing.
static int DUPLEX_SIMPLEX
          Constant value for simplex printing.
static int DUPLEX_TUMBLE
          Constant value for tumble duplex printing.
static int FONT_COURIER_10
          Constant value for a Courier, 10 pitch font.
static int FONT_COURIER_12
          Constant value for a Courier, 12 pitch font.
static int FONT_COURIER_15
          Constant value for a Courier, 15 pitch font.
static int FONT_COURIER_17
          Constant value for a Courier, 17 pitch font.
static int FONT_COURIER_5
          Constant value for a Courier, 5 pitch font.
static int FONT_COURIER_BOLD_10
          Constant value for a Courier, bold, 10 pitch font.
static int FONT_COURIER_BOLD_17
          Constant value for a Courier, bold, 17 pitch font.
static int FONT_COURIER_BOLD_5
          Constant value for a Courier, bold, 5 pitch font.
static int FONT_COURIER_ITALIC_10
          Constant value for a Courier, italic, 10 pitch font.
static int FONT_COURIER_ITALIC_12
          Constant value for a Courier, italic, 12 pitch font.
static int FONT_GOTHIC_10
          Constant value for a Gothic, 10 pitch font.
static int FONT_GOTHIC_12
          Constant value for a Gothic, 12 pitch font.
static int FONT_GOTHIC_13
          Constant value for a Gothic, 13 pitch font.
static int FONT_GOTHIC_15
          Constant value for a Gothic, 15 pitch font.
static int FONT_GOTHIC_20
          Constant value for a Gothic, 20 pitch font.
static int FONT_GOTHIC_27
          Constant value for a Gothic, 27 pitch font.
static int FONT_GOTHIC_BOLD_10
          Constant value for a Gothic, bold, 10 pitch font.
static int FONT_GOTHIC_BOLD_12
          Constant value for a Gothic, bold, 12 pitch font.
static int FONT_GOTHIC_ITALIC_12
          Constant value for a Gothic, italic, 12 pitch font.
static int FONT_LETTER_GOTHIC_12
          Constant value for a letter Gothic, 12 pitch font.
static int FONT_LETTER_GOTHIC_BOLD_12
          Constant value for a letter Gothic, bold, 12 pitch font.
static int FONT_OCR_A_10
          Constant value for an OCR A, 10 pitch font.
static int FONT_OCR_B_10
          Constant value for an OCR B, 10 pitch font.
static int FONT_ORATOR_10
          Constant value for an Oritor, 10 pitch font.
static int FONT_ORATOR_BOLD_10
          Constant value for an Oritor, bold, 10 pitch font.
static int FONT_PRESTIGE_10
          Constant value for a Prestige, 10 pitch font.
static int FONT_PRESTIGE_12
          Constant value for a Prestige, 12 pitch font.
static int FONT_PRESTIGE_15
          Constant value for a Prestige, 15 pitch font.
static int FONT_PRESTIGE_BOLD_12
          Constant value for a Prestige, bold, 12 pitch font.
static int FONT_PRESTIGE_ITALIC_12
          Constant value for a Prestige, italic, 12 pitch font.
static int FONT_ROMAN_10
          Constant value for a Roman, 10 pitch font.
static int FONT_SCRIPT_12
          Constant value for a script, 12 pitch font.
static int FONT_SERIF_10
          Constant value for a Serif, 10 pitch font.
static int FONT_SERIF_12
          Constant value for a Serif, 12 pitch font.
static int FONT_SERIF_15
          Constant value for a Serif, 15 pitch font
static int FONT_SERIF_BOLD_12
          Constant value for a Serif, bold, 12 pitch font.
static int FONT_SERIF_ITALIC_10
          Constant value for a Serif, italic, 10 pitch font.
static int FONT_SERIF_ITALIC_12
          Constant value for a Serif, italic, 12 pitch font.
 
Fields inherited from class com.ibm.as400.access.SCS5219Writer
QUALITY_DRAFT, QUALITY_NEAR_LETTER
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
SCS3812Writer(OutputStream out)
          Deprecated. Replaced by SCS3812Writer(OutputStream, int, AS400). Any SCS3812Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
SCS3812Writer(OutputStream out, int ccsid)
          Deprecated. Replaced by SCS3812Writer(OutputStream, int, AS400). Any SCS3812Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
SCS3812Writer(OutputStream out, int ccsid, AS400 system)
          Constructs a SCS3812Writer.
SCS3812Writer(OutputStream out, String encoding)
          Deprecated. Replaced by SCS3812Writer(OutputStream, int, AS400). Any SCS3812Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
 
Method Summary
 void endPage()
          Ends current page.
 void setBold(boolean bold)
          Sets bold text on or off.
 void setDuplex(int duplex)
          Sets duplex printing mode.
 void setFont(int font)
          Sets the current font.
 void setTextOrientation(int orientation)
          Sets text orientation.
 
Methods inherited from class com.ibm.as400.access.SCS5219Writer
setCodePage, setCPI, setDestinationDrawer, setEnvelopeSize, setLeftMargin, setPaperSize, setQuality, setSourceDrawer, setUnderline
 
Methods inherited from class com.ibm.as400.access.SCS5224Writer
setLPI
 
Methods inherited from class com.ibm.as400.access.SCS5256Writer
absoluteHorizontalPosition, absoluteVerticalPosition, carriageReturn, close, flush, getEncoding, lineFeed, newLine, relativeHorizontalPosition, relativeVerticalPosition, setHorizontalFormat, setVerticalFormat, write, write, write, write
 
Methods inherited from class java.io.Writer
append, append, append, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUPLEX_DUPLEX

public static final int DUPLEX_DUPLEX
Constant value for duplex printing.

See Also:
Constant Field Values

DUPLEX_SIMPLEX

public static final int DUPLEX_SIMPLEX
Constant value for simplex printing.

See Also:
Constant Field Values

DUPLEX_TUMBLE

public static final int DUPLEX_TUMBLE
Constant value for tumble duplex printing.

See Also:
Constant Field Values

FONT_COURIER_10

public static final int FONT_COURIER_10
Constant value for a Courier, 10 pitch font.

See Also:
Constant Field Values

FONT_COURIER_12

public static final int FONT_COURIER_12
Constant value for a Courier, 12 pitch font.

See Also:
Constant Field Values

FONT_COURIER_15

public static final int FONT_COURIER_15
Constant value for a Courier, 15 pitch font.

See Also:
Constant Field Values

FONT_COURIER_17

public static final int FONT_COURIER_17
Constant value for a Courier, 17 pitch font.

See Also:
Constant Field Values

FONT_COURIER_5

public static final int FONT_COURIER_5
Constant value for a Courier, 5 pitch font.

See Also:
Constant Field Values

FONT_COURIER_BOLD_10

public static final int FONT_COURIER_BOLD_10
Constant value for a Courier, bold, 10 pitch font.

See Also:
Constant Field Values

FONT_COURIER_BOLD_17

public static final int FONT_COURIER_BOLD_17
Constant value for a Courier, bold, 17 pitch font.

See Also:
Constant Field Values

FONT_COURIER_BOLD_5

public static final int FONT_COURIER_BOLD_5
Constant value for a Courier, bold, 5 pitch font.

See Also:
Constant Field Values

FONT_COURIER_ITALIC_10

public static final int FONT_COURIER_ITALIC_10
Constant value for a Courier, italic, 10 pitch font.

See Also:
Constant Field Values

FONT_COURIER_ITALIC_12

public static final int FONT_COURIER_ITALIC_12
Constant value for a Courier, italic, 12 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_10

public static final int FONT_GOTHIC_10
Constant value for a Gothic, 10 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_12

public static final int FONT_GOTHIC_12
Constant value for a Gothic, 12 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_13

public static final int FONT_GOTHIC_13
Constant value for a Gothic, 13 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_15

public static final int FONT_GOTHIC_15
Constant value for a Gothic, 15 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_20

public static final int FONT_GOTHIC_20
Constant value for a Gothic, 20 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_27

public static final int FONT_GOTHIC_27
Constant value for a Gothic, 27 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_BOLD_10

public static final int FONT_GOTHIC_BOLD_10
Constant value for a Gothic, bold, 10 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_BOLD_12

public static final int FONT_GOTHIC_BOLD_12
Constant value for a Gothic, bold, 12 pitch font.

See Also:
Constant Field Values

FONT_GOTHIC_ITALIC_12

public static final int FONT_GOTHIC_ITALIC_12
Constant value for a Gothic, italic, 12 pitch font.

See Also:
Constant Field Values

FONT_LETTER_GOTHIC_12

public static final int FONT_LETTER_GOTHIC_12
Constant value for a letter Gothic, 12 pitch font.

See Also:
Constant Field Values

FONT_LETTER_GOTHIC_BOLD_12

public static final int FONT_LETTER_GOTHIC_BOLD_12
Constant value for a letter Gothic, bold, 12 pitch font.

See Also:
Constant Field Values

FONT_OCR_A_10

public static final int FONT_OCR_A_10
Constant value for an OCR A, 10 pitch font.

See Also:
Constant Field Values

FONT_OCR_B_10

public static final int FONT_OCR_B_10
Constant value for an OCR B, 10 pitch font.

See Also:
Constant Field Values

FONT_ORATOR_10

public static final int FONT_ORATOR_10
Constant value for an Oritor, 10 pitch font.

See Also:
Constant Field Values

FONT_ORATOR_BOLD_10

public static final int FONT_ORATOR_BOLD_10
Constant value for an Oritor, bold, 10 pitch font.

See Also:
Constant Field Values

FONT_PRESTIGE_10

public static final int FONT_PRESTIGE_10
Constant value for a Prestige, 10 pitch font.

See Also:
Constant Field Values

FONT_PRESTIGE_12

public static final int FONT_PRESTIGE_12
Constant value for a Prestige, 12 pitch font.

See Also:
Constant Field Values

FONT_PRESTIGE_15

public static final int FONT_PRESTIGE_15
Constant value for a Prestige, 15 pitch font.

See Also:
Constant Field Values

FONT_PRESTIGE_BOLD_12

public static final int FONT_PRESTIGE_BOLD_12
Constant value for a Prestige, bold, 12 pitch font.

See Also:
Constant Field Values

FONT_PRESTIGE_ITALIC_12

public static final int FONT_PRESTIGE_ITALIC_12
Constant value for a Prestige, italic, 12 pitch font.

See Also:
Constant Field Values

FONT_ROMAN_10

public static final int FONT_ROMAN_10
Constant value for a Roman, 10 pitch font.

See Also:
Constant Field Values

FONT_SCRIPT_12

public static final int FONT_SCRIPT_12
Constant value for a script, 12 pitch font.

See Also:
Constant Field Values

FONT_SERIF_10

public static final int FONT_SERIF_10
Constant value for a Serif, 10 pitch font.

See Also:
Constant Field Values

FONT_SERIF_12

public static final int FONT_SERIF_12
Constant value for a Serif, 12 pitch font.

See Also:
Constant Field Values

FONT_SERIF_15

public static final int FONT_SERIF_15
Constant value for a Serif, 15 pitch font

See Also:
Constant Field Values

FONT_SERIF_BOLD_12

public static final int FONT_SERIF_BOLD_12
Constant value for a Serif, bold, 12 pitch font.

See Also:
Constant Field Values

FONT_SERIF_ITALIC_10

public static final int FONT_SERIF_ITALIC_10
Constant value for a Serif, italic, 10 pitch font.

See Also:
Constant Field Values

FONT_SERIF_ITALIC_12

public static final int FONT_SERIF_ITALIC_12
Constant value for a Serif, italic, 12 pitch font.

See Also:
Constant Field Values
Constructor Detail

SCS3812Writer

public SCS3812Writer(OutputStream out)
Deprecated. Replaced by SCS3812Writer(OutputStream, int, AS400). Any SCS3812Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.

Constructs a SCS3812Writer. The default encoding will be used.

Parameters:
out - An OutputStream.

SCS3812Writer

public SCS3812Writer(OutputStream out,
                     int ccsid)
              throws UnsupportedEncodingException
Deprecated. Replaced by SCS3812Writer(OutputStream, int, AS400). Any SCS3812Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.

Constructs a SCS3812Writer.

Parameters:
out - An OutputStream.
ccsid - The name of the target CCSID to be used.
Throws:
UnsupportedEncodingException - If ccsid is invalid.

SCS3812Writer

public SCS3812Writer(OutputStream out,
                     int ccsid,
                     AS400 system)
              throws UnsupportedEncodingException
Constructs a SCS3812Writer.

Parameters:
out - An OutputStream.
ccsid - The name of the target CCSID to be used.
system - The system
Throws:
UnsupportedEncodingException - If ccsid is invalid.

SCS3812Writer

public SCS3812Writer(OutputStream out,
                     String encoding)
              throws UnsupportedEncodingException
Deprecated. Replaced by SCS3812Writer(OutputStream, int, AS400). Any SCS3812Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.

Constructs a SCS3812Writer.

Parameters:
out - An OutputStream.
encoding - The name of the target encoding to be used.
Throws:
UnsupportedEncodingException - If encoding is invalid.
Method Detail

endPage

public void endPage()
             throws IOException
Ends current page.

Overrides:
endPage in class SCS5219Writer
Throws:
IOException - If an error occurs while communicating with the system.

setBold

public void setBold(boolean bold)
             throws IOException
Sets bold text on or off.

Parameters:
bold - If true, turns bold on; if false, turns bold off. 4
Throws:
IOException - If an error occurs while communicating with the system.

setDuplex

public void setDuplex(int duplex)
Sets duplex printing mode. This is set once at the start of each page. Changes in duplex print mode will not take effect until the next new page.

Parameters:
duplex - The duplex setting. Valid values are DUPLEX_DUPLEX, DUPLEX_SIMPLEX, or DUPLEX_TUMBLE.

setFont

public void setFont(int font)
             throws IOException
Sets the current font. This method will override the setCPI function.

Parameters:
font - The current font. Constant values are defined for the valid values.
Throws:
IOException - If an error occurs while communicating with the system.

setTextOrientation

public void setTextOrientation(int orientation)
Sets text orientation. This is set once at the start of each page. Changes in text orientation will not take effect until the next new page.

Parameters:
orientation - The text orientation on the paper. Valid values are 0, 90, 180 and 270.