Coder Social home page Coder Social logo

custom-printer's Introduction

Custom printer library on nodejs

Custom printer library written on serialport and canvas libraries. Tested only with VKP-80III and K-80 models. K-80 is missing a lot's of features of VKP-80III.

1. Pre-installation

1) Install canvas pre-dependencies for using image printing on your printer

OS Command
OS X Using Homebrew: brew install pkg-config cairo pango libpng jpeg giflib librsvg
Ubuntu sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Fedora sudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
Solaris pkgin install cairo pango pkg-config xproto renderproto kbproto xextproto
OpenBSD doas pkg_add cairo pango png jpeg giflib
Windows See the wiki
Others See the wiki

Mac OS X v10.11+: If you have recently updated to Mac OS X v10.11+ and are experiencing trouble when compiling, run the following command: xcode-select --install. Read more about the problem on Stack Overflow. If you have xcode 10.0 or higher installed, in order to build from source you need NPM 6.4.1 or higher

2.) Run npm install

npm install

3.) Setup configuration file

Configure config file, also there is example config file, which you can copy and edit.

Type has only two argument: vkp80iii or k80. If portConfiguration is null, only commands will be printed on console.

{
    "type": "vkp80iii",
    "portConfiguration": {
        "port": "/dev/ttyUSB0",
        "baudRate": 115200
    }
}

2. Usage

npm run test

and it will print test print on your ESC-POS custom printer :) have fun.

Pull requests are welcome :)

custom-printer's People

Contributors

dependabot[bot] avatar landg16 avatar nikalosa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

custom-printer's Issues

Command codes for QR-Code "version" and "dot size" may be reversed

I am currently implementing the VKP80III driver in .NET and noticed, that the command codes for settings the QR code version and the QR code dot size seem to be wrong in the VKP Commands Manual.

Specify QRcode barcode version

1D 28 6B pL pH 31 42 n

Specify dot size of the module of the QRcode barcode

1D 28 6B pL pH 31 43 n

You implemented it according to the manual:

this.write(Buffer.from([0x1D, 0x28, 0x6B, 0x03, 0x00, 0x31, 0x42, 0x0A])) // Set QRCode Version

However, for my VKP80III printer, 0x42 sets the dot size and 0x43 specifies the version. So either my printer firmware is buggy, or the documentation is wrong.

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.