https://github.com/nwutils/nwjs-print-server
Websocket server to interface a website with a printer
https://github.com/nwutils/nwjs-print-server
Last synced: 9 months ago
JSON representation
Websocket server to interface a website with a printer
- Host: GitHub
- URL: https://github.com/nwutils/nwjs-print-server
- Owner: nwutils
- License: mit
- Created: 2015-05-03T13:52:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-08T11:55:35.000Z (over 10 years ago)
- Last Synced: 2025-03-23T21:46:01.160Z (9 months ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 12
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nwjs-print-server
A simple [nw.js](https://github.com/nwjs/nw.js) application that bridges a website to a local printer (I.E. printing recipes from a web application)
## Installation
Clone this repo, setup the application using `npm install`
## Usages
**server side** :
```bash
npm start
```
**client side**:
```javascript
$(function () {
// Connects to localserver
var printServer = io('http://localhost:9001');
// Waits for connect event
printServer.on('connect', function () {
// Launches a raw-print on the selected printer.
// you can select the default printer using the tooltip menu of the nw.js's tray icon
printServer.emit('raw-print', 'raw data');
});
});
```