Class AbstractEpsonPrinterDriver

    • Constructor Detail

      • AbstractEpsonPrinterDriver

        protected AbstractEpsonPrinterDriver​(OutputStream out,
                                             float charsPerInch,
                                             float linesPerInch,
                                             String printerModel)
    • Method Detail

      • getFontMapper

        public FontMapper getFontMapper()
      • setFontMapper

        public void setFontMapper​(FontMapper fontMapper)
      • isFirstPage

        protected boolean isFirstPage()
      • 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
      • 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.
      • sendFontStyle

        protected abstract void sendFontStyle​(boolean bold,
                                              boolean italic,
                                              boolean underline,
                                              boolean strikeTrough)
                                       throws IOException
        Throws:
        IOException
      • 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
      • 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
      • sendDefineCharacterWidth

        protected void sendDefineCharacterWidth​(float charactersPerInch)
                                         throws IOException
        Throws:
        IOException
      • sendDefineLineSpacing

        protected abstract void sendDefineLineSpacing​(float lineHeightInPoints)
                                               throws IOException
        Throws:
        IOException
      • sendDefinePageLengthInLines

        protected void sendDefinePageLengthInLines​(int paperSizeInLines)
                                            throws IOException
        Throws:
        IOException
      • sendDefineHorizontalBorders

        protected void sendDefineHorizontalBorders​(int left,
                                                   int right)
                                            throws IOException
        Throws:
        IOException
      • sendDefineUserCharacters

        protected void sendDefineUserCharacters()
      • getFallBackCharset

        public byte getFallBackCharset()
      • setFallBackCharset

        public void setFallBackCharset​(byte fallBackCharset)