com.ibm.as400.access

Class SCS5219Writer

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable
    Direct Known Subclasses:
    SCS3812Writer


    public class SCS5219Writer
    extends SCS5224Writer
    The SCS5219Writer class writes an SCS 5219 data stream to an output stream, translating characters into bytes of the specified CCSID. SCS5219Writer extends SCS5224Writer and adds support for left margin, underline, form type (paper or envelope), form size, print quality, code page, character set, source drawer number, and destination drawer number.
    See Also:
    SCS5224Writer
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int QUALITY_DRAFT
      Constant value for draft print quality.
      static int QUALITY_NEAR_LETTER
      Constant value for near letter print quality.
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor and Description
      SCS5219Writer(java.io.OutputStream out)
      Deprecated. 
      Replaced by SCS5219Writer(OutputStream, int, AS400). Any SCS5219Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
      SCS5219Writer(java.io.OutputStream out, int ccsid)
      Deprecated. 
      Replaced by SCS5219Writer(OutputStream, int, AS400). Any SCS5219Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
      SCS5219Writer(java.io.OutputStream out, int ccsid, AS400 system)
      Constructs a SCS5219Writer.
      SCS5219Writer(java.io.OutputStream out, java.lang.String encoding)
      Deprecated. 
      Replaced by SCS5219Writer(OutputStream, int, AS400). Any SCS5219Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
    • Field Detail

      • QUALITY_DRAFT

        public static final int QUALITY_DRAFT
        Constant value for draft print quality.
        See Also:
        Constant Field Values
      • QUALITY_NEAR_LETTER

        public static final int QUALITY_NEAR_LETTER
        Constant value for near letter print quality.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SCS5219Writer

        public SCS5219Writer(java.io.OutputStream out)
        Deprecated. Replaced by SCS5219Writer(OutputStream, int, AS400). Any SCS5219Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
        Constructs a SCS5219Writer. The default encoding will be used.
        Parameters:
        out - An OutputStream.
      • SCS5219Writer

        public SCS5219Writer(java.io.OutputStream out,
                     int ccsid)
                      throws java.io.UnsupportedEncodingException
        Deprecated. Replaced by SCS5219Writer(OutputStream, int, AS400). Any SCS5219Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
        Constructs a SCS5219Writer.
        Parameters:
        out - An OutputStream.
        ccsid - The name of the target CCSID to be used.
        Throws:
        java.io.UnsupportedEncodingException - If ccsid is invalid.
      • SCS5219Writer

        public SCS5219Writer(java.io.OutputStream out,
                     int ccsid,
                     AS400 system)
                      throws java.io.UnsupportedEncodingException
        Constructs a SCS5219Writer.
        Parameters:
        out - An OutputStream.
        ccsid - The name of the target CCSID to be used.
        system - The system.
        Throws:
        java.io.UnsupportedEncodingException - If ccsid is invalid.
      • SCS5219Writer

        public SCS5219Writer(java.io.OutputStream out,
                     java.lang.String encoding)
                      throws java.io.UnsupportedEncodingException
        Deprecated. Replaced by SCS5219Writer(OutputStream, int, AS400). Any SCS5219Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.
        Constructs a SCS5219Writer.
        Parameters:
        out - An OutputStream.
        encoding - The name of the target encoding to be used.
        Throws:
        java.io.UnsupportedEncodingException - If encoding is invalid.
    • Method Detail

      • endPage

        public void endPage()
                     throws java.io.IOException
        Ends current page.
        Overrides:
        endPage in class SCS5256Writer
        Throws:
        java.io.IOException - If an error occurs while communicating with the system.
      • setCodePage

        public void setCodePage(int codepage,
                       int charset)
                         throws java.io.IOException
        Sends Set GCGID through GCID (SCG) command to set the code page and character set. This method must be called before the first character is printed. Invalid values of codepage and charset may cause a printer exception.
        Parameters:
        codepage - The code page to be set.
        charset - The new character set.
        Throws:
        java.io.IOException - If an error occurs while communicating with the system.
      • setCPI

        public void setCPI(int cpi)
                    throws java.io.IOException
        Sets characters per inch. All following text will be in the set pitch.
        Overrides:
        setCPI in class SCS5224Writer
        Parameters:
        cpi - The characters per inch. Valid values are 10, 12 and 15.
        Throws:
        java.io.IOException - If an error occurs while communicating with the system.
      • setDestinationDrawer

        public void setDestinationDrawer(int drawer)
        Sets destination drawer number. This is set once at the start of each page. Changes in the destination drawer will not take effect until the next new page.
        Parameters:
        drawer - The number of the drawer to select. Valid values are 1 to 255.
      • setEnvelopeSize

        public void setEnvelopeSize(double width,
                           double length)
        Sets envelope size. This is set once at the start of each page. Changes in the envelope size will not take effect until the next new page.
        Parameters:
        width - The envelope width in inches. Valid values are 0.1 to 14.0.
        length - The envelope width in inches. Valid values are 0.1 to 14.0.
      • setLeftMargin

        public void setLeftMargin(double leftMargin)
                           throws java.io.IOException
        Sets the left margin. Call this method only while at a line boundary or a printer exception will occur.
        Parameters:
        leftMargin - The margin distance from the left paper edge in inches. Valid values are 0.0 to 14.0.
        Throws:
        java.io.IOException - If an error occurs while communicating with the system.
      • setPaperSize

        public void setPaperSize(double width,
                        double length)
        Sets paper size. This is set once at the start of each page. Changes in the paper size will not take effect until the next new page.
        Parameters:
        width - The paper width in inches. Valid values are 0.1 to 14.0.
        length - The paper length in inches. Valid values are 0.1 to 14.0.
      • setQuality

        public void setQuality(int quality)
        Sets quality printing. This is set once at the start of each page. Changes in quality will not take effect until the next new page.
        Parameters:
        quality - The type of quality printing. Valid values are QUALITY_DRAFT and QUALITY_NEAR_LETTER.
      • setSourceDrawer

        public void setSourceDrawer(int drawer)
        Sets source drawer number. This is set once at the start of each page. Changes in the source drawer will not take effect until the next new page.
        Parameters:
        drawer - The number of the drawer to select. Valid values are 1 to 255.
      • setUnderline

        public void setUnderline(boolean ul)
                          throws java.io.IOException
        Sets underline on or off.
        Parameters:
        ul - If true, turns underline on; if false, turns underline off.
        Throws:
        java.io.IOException - If an error occurs while communicating with the system.