GithubHelp home page GithubHelp logo

esc-pos-lib's Introduction

# esc-pos-lib A library for the use of an ESC/POS-thermal printer

Test image for the image library is from here. Free to use with the unsplash license. Thanks Taraqur Rahman for the picture.

esc-pos-lib's People

Contributors

antonjoha avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

elmica

esc-pos-lib's Issues

Failed implementations

This is a list of implementations which have been attempted but failed.
They were then not deemed that important and therefore thrown here.
Might or might not touch them later

QR code

We want to be able to print qr codes. There should be 6 different operations to implement for this.

  • QR Code: Select the model
  • QR Code: Set the size of module
  • QR Code: Select the error correction level
  • QR Code: Store the data in the symbol storage area
  • QR Code: Print the symbol data in the symbol storage area
  • QR Code: Transmit the size information of the symbol data in the symbol storage area

What to do

There are a number of commands which need to be implemented. They are listed below but should later get their own issues as needed.

  • Horizontal tab
  • Print and line feed
  • Print and return to Standard mode (in Page mode)
  • End job (in Standard mode)
  • Print and carriage return
  • Transmit real-time status
  • Send real-time request to printer
  • Generate pulse in real-time
  • Execute power-off sequence
  • Sound buzzer in real-time
  • Transmit specified status in real time
  • Clear buffer(s)
  • Cancel print data in Page mode
  • Print data in Page mode
  • Set right-side character spacing
  • Select print mode(s)
  • Set absolute print position
  • Select/cancel user-defined character set
  • Define user-defined characters
  • Control beeper tones
  • Beep the buzzer
  • Model specific buzzer control (fn=97)
  • Model specific buzzer control (fn=98)
  • Model specific buzzer control (fn=99)
  • Specify batch print
  • Select bit-image mode
  • Turn underline mode on/off
  • Select default line spacing
  • Set line spacing
  • Return home
  • Select peripheral device
  • Cancel user-defined characters
  • Initialize printer
  • Set horizontal tab positions
  • Turn emphasized mode on/off
  • Turn double-strike mode on/off
  • Print and feed paper
  • Print and reverse feed
  • Select Page mode
  • Select character font
  • Select an international character set
  • Select Standard mode
  • Select print direction in Page mode
  • Turn unidirectional print mode on/off
  • Turn 90° clockwise rotation mode on/off
  • Set print area in Page mode
  • Set relative print position
  • Select justification
  • Select paper sensor(s) to output paper-end signals
  • Select paper sensor(s) to stop printing
  • Enable/disable panel buttons
  • Print and feed n lines
  • Print and reverse feed n lines
  • Partial cut (one point left uncut)
  • Partial cut (three points left uncut)
  • Generate pulse
  • Select print color
  • Select character code table
  • Transmit peripheral device status
  • Transmit paper sensor status
  • Turn upside-down print mode on/off
  • Select print mode(s) for Kanji characters
  • Select Kanji character mode
  • Select Kanji character style(s)
  • Select Kanji character font
  • Select code conversion method
  • Select character encode system
  • Set font priority
  • Group of commands for receipt enhancement control
  • Transmit set values for top/bottom logo printing
  • Set top logo printing
  • Set bottom logo printing
  • Make extended settings for top/bottom logo printing
  • Enable/disable top/bottom logo printing
  • Select label and black mark control function(s)
  • Paper layout setting
  • Paper layout information transmission
  • Transmit the positioning information
  • Feed paper to the label peeling position
  • Feed paper to the cutting position
  • Feed paper to the print starting position
  • Paper layout error special margin setting
  • Enable/disable Automatic Status Back (ASB) for optional functions (extended status)
  • Turn underline mode on/off for Kanji characters
  • Cancel Kanji character mode
  • Define user-defined Kanji characters
  • Cancel user-defined Kanji characters
  • Select Kanji character code system
  • Set Kanji character spacing
  • Turn quadruple-size mode on/off for Kanji characters
  • Write to NV user memory
  • Read from NV user memory
  • Print NV bit image
  • Define NV bit image
  • Select character size
  • Set absolute vertical print position in Page mode
  • Execute test print
  • Edit NV user memory
  • Delete the specified record
  • Store the data in the specified record
  • Transmit the data in the specified record
  • Transmit capacity of the NV user memory currently being used
  • Transmit the remaining capacity of the NV user memory
  • Transmit the key code list
  • Delete all data in the NV user memory
  • Enable/disable real-time command
  • Set user setup commands
  • Change into the user setting mode
  • End the user setting mode session
  • Change the memory switch
  • Change the memory switch
  • Set the customized setting values
  • Transmit the customized setting values
  • Copy the user-defined page
  • Define the data (column format) for the character code page
  • Define the data (raster format) for the character code page
  • Delete the data for the character code page
  • Set the configuration item for the serial interface
  • Transmit the configuration item for the serial interface
  • Set the configuration item for the Bluetooth interface
  • Transmit the configuration item for the Bluetooth interface
  • Set conditions for USB interface communication
  • Transmit conditions for USB interface communication
  • Delete the paper layout
  • Set the paper layout
  • Transmit the paper layout information
  • Set the control for label paper and paper with black marks
  • Transmit the control settings for label paper and paper with black marks
  • Set internal buzzer patterns
  • Transmit internal buzzer patterns
  • Request transmission of response or status
  • Specifies the process ID response
  • Specifies the offline response
  • Select print control method(s)
  • Select the print control mode
  • Select the print density
  • Select the print speed
  • Select the number of parts for the thermal head energizing
  • Set graphics data
  • Transmit the NV graphics memory capacity
  • Set the reference dot density for graphics
  • Print the graphics data in the print buffer
  • Transmit the remaining capacity of the NV graphics memory
  • Transmit the remaining capacity of the download graphics memory
  • Transmit the key code list for defined NV graphics
  • Delete all NV graphics data
  • Delete the specified NV graphics data
  • Define the NV graphics data (raster format)
  • Define the NV graphics data (column format)
  • Print the specified NV graphics data
  • Transmit the key code list for defined download graphics
  • Delete all download graphics data
  • Delete the specified download graphics data
  • Define the download graphics data (raster format)
  • Define the download graphics data (column format)
  • Print the specified download graphics data
  • Store the graphics data in the print buffer (raster format)
  • Store the graphics data in the print buffer (column format)
  • Customize printer control value(s)
  • Save the setting values from the work area into the storage area
  • Load the setting values stored in the storage area to the work area
  • Select the setting values loaded to the work area after the initialization process
  • Select character effects
  • Select character color
  • Select background color
  • Turn shading mode on/off
  • Page mode control
  • Set the printable area in Page mode
  • Commands for drawing graphics
  • Draw line
  • Draw rectangle
  • Specify paper cut
  • Paper cut
  • Paper feed and cut
  • Paper cut reservation
  • Set up and print the symbol
  • PDF417: Set the number of columns in the data region
  • PDF417: Set the number of rows
  • PDF417: Set the width of the module
  • PDF417: Set the row height
  • PDF417: Set the error correction level
  • PDF417: Select the options
  • PDF417: Store the data in the symbol storage area
  • PDF417: Print the symbol data in the symbol storage area
  • PDF417: Transmit the size information of the symbol data in the symbol storage area
  • QR Code: Select the model
  • QR Code: Set the size of module
  • QR Code: Select the error correction level
  • QR Code: Store the data in the symbol storage area
  • QR Code: Print the symbol data in the symbol storage area
  • QR Code: Transmit the size information of the symbol data in the symbol storage area
  • MaxiCode: Select the mode
  • MaxiCode: Store the data in the symbol storage area
  • MaxiCode: Print the symbol data in the symbol storage area
  • MaxiCode: Transmit the size information of the symbol data in the symbol storage area
  • 2-dimensional GS1 DataBar: Set the width of the module
  • 2-dimensional GS1 DataBar: GS1 DataBar Expanded Stacked maximum width setting
  • 2-dimensional GS1 DataBar: Store data in the symbol storage area
  • 2-dimensional GS1 DataBar: Print the symbol data in the symbol storage area
  • 2-dimensional GS1 DataBar: Transmit the size information of the symbol data in the symbol storage area
  • Composite Symbology: Set the width of the module
  • Composite Symbology: GS1 DataBar Expanded Stacked maximum width setting
  • Composite Symbology: Select HRI character font
  • Composite Symbology: Store the data in the symbol storage area
  • Composite Symbology: Print the symbol data in the symbol storage area
  • Composite Symbology: Transmit the size information of the symbol data in the symbol storage area
  • Aztec Code: Set the number of mode types and data layers
  • Aztec Code: Set the size of the module
  • Aztec Code: Set the error correction level
  • Aztec Code: Store the data in the symbol storage area
  • Aztec Code: Print the symbol data in the symbol storage area
  • Aztec Code: Transmit the size information of the symbol data in the symbol storage area
  • DataMatrix: Set the symbol type, number of columns, number of rows
  • DataMatrix: Set the size of the module
  • DataMatrix: Store the data in the symbol storage area
  • DataMatrix: Print the symbol data in the symbol storage area
  • DataMatrix: Transmit the size information of the symbol data in the symbol storage area
  • Define downloaded bit image
  • Print downloaded bit image
  • Start/end macro definition
  • Turn white/black reverse print mode on/off
  • Select counter print mode
  • Select count mode (A)
  • Set counter
  • Select count mode (B)
  • Specify Windows BMP graphics data
  • Define Windows BMP NV graphics data
  • Define Windows BMP download graphics data
  • Select print position of HRI characters
  • Transmit printer ID
  • Set left margin
  • Set horizontal and vertical motion units
  • Print variable vertical size bit image
  • Set print position to the beginning of print line
  • Select cut mode and cut paper
  • Set print area width
  • Set relative vertical print position in Page mode
  • Execute macro
  • Enable/disable Automatic Status Back (ASB)
  • Turn smoothing mode on/off
  • Print counter
  • Select font for HRI characters
  • Initialize maintenance counter
  • Transmit maintenance counter
  • Set barcode height
  • Enable/disable Automatic Status Back (ASB) for ink
  • Print barcode
  • Transmit status
  • Print raster bit image
  • Set barcode width
  • Set online recovery wait time

Send basic text

We need to be able to send text to the printer as initial start.
This will need two things

  • Connection to the printer
  • Printer class which can prepare a simple message

A simple message is in this case text + the ability to cut

Print image

It's time to create the api for image printing

  • Find the required commands
  • Implement them

Handle image files

We can now print images, next step is to handle image files. We want to be able to open them, dither and send to printer

Print barcode

Implement the functions which have to do with barcode printing

  • Print barcode
  • Set barcode height
  • Set barcode width

Some standard commands

There are a bunch of standard commands that need to be localized and then added.
This will start of with the list below, but might grow later:

  • Print and line feed
  • Print and return to Standard mode (in Page mode)
  • End job (in Standard mode)
  • End job (in Standard mode)
  • Print and feed paper
  • Print and reverse feed
  • Print and feed n lines
  • Print and reverse feed n lines
  • Turn smoothing mode on/off
  • [ ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.