Skip to content
/ printrz Public

A bridge used to talk with printers using raw commands (esc/pos 100% compatible)

License

Notifications You must be signed in to change notification settings

Guidap/printrz

Repository files navigation

Printrz

Printrz is a bridge between web app and printers installed on the OS.

It was originally built to send raw ESC/POS commands to thermal printers from a web point of sale but this project can answer other purposes (see API doc for more).

Introduction

The initial purpose of this application was to send ESC/POS commands to thermal printers from a web app. Since the API implements the lovely (♥) node-printer project, the API can theorically be used to print PDF, JPG and whatsoever.

Currently, this app is used by GUIDAP's customers to print cash receipt from a desktop device.

Roadmap to v1

  • Fix auto update (since v0.1.1)
  • Sign app binaries
  • Add "Reload printers" button (#3)
  • Show printer state and indicate the default printer of the OS
  • Server settings page (host, port) (#6)
  • Show local IP on server settings page (#4)
  • Add API Documentation page
  • Add self-signed certificates generation for HTTPS origin support (#6)
  • Allow the user to override the default printer
  • Allow the user to chose the best print test between ESC/POS, JPG, PDF and plain text
  • Unit and fonctional testing
  • Create a fancy logo

Roadmap to v2

  • Separate Electron app and API to different projects (the API could be useful as a standalone command line tool)

How to use

Install the latest release of Printrz on your favorite operating system.

Open this JSFiddle and try yourself !

API :

Route Method Body Description
/ GET Server healthcheck endpoint. No more, no less.
/printers GET Get the list of installed printers.
/job POST { "printer": "printer-identifier", "type": "type: RAW, TEXT, PDF, JPEG, ...", "data": "command"} Print something on the desired printer.

This API expose some node-printer features so if you don't find the information you need here, it could be usefull to check the documentation of this project 👍.

Contribute

Follow the guidelines exposed in the CONTRIBUTING file.

How to develop

Prerequisites

You have to install Node (LTS) and Yarn.

Windows users

Install Python (executable installer).

Follow this tutorial to know the Python executable path.

Open the Node Prompt as administrator and run the following command :

$ set PYTHON=C:\Users\...\AppData\Local\Programs\Python\Python37\python.exe # Change with your own Path
$ npm install --global --production [email protected]
$ yarn config set msvs_version 2017
$ set GYP_MSVS_VERSION=2017

Build Setup

# install dependencies
$ yarn

# serve with hot reload at localhost:9080
$ yarn dev

# Build (only) electron application for production
# On windows:
$ yarn build --win
# On OSX:
$ yarn build --macos
# On Debian/Ubuntu:
$ yarn build --linux

# Build and release electron application for production
# We have to create a new tag first
$ yarn version # set the <new version>
$ git tag <new version>
$ git push && git push --tags
# On windows:
$ yarn release --win
# On OSX:
$ yarn release --macos
# On Debian/Ubuntu:
$ yarn release --linux

# run unit tests
$ yarn test

# lint all JS/Vue component files in `src/`
$ yarn lint

Special thanks

To @tojocky with his node-printer project ❤️.

This project was generated with electron-vue using vue-cli. Documentation about the original structure can be found here.

About

A bridge used to talk with printers using raw commands (esc/pos 100% compatible)

Resources

License

Stars

Watchers

Forks

Packages

No packages published