A printers server for web applications.
const { data } = await fetch('http://127.0.0.1:4125/printers', {
headers: {
'X-PIN': '123456'
}
})
const { data } = await fetch('http://127.0.0.1:4125/print', {
method: 'POST',
headers: {
'X-PIN': '123456'
}
})
See
src/server/index.js
for more.
There is sample usage in sample/
directory, to run the sample you need to (assumming you have installed and running pinter).
- change the working directory to
sample/
cd sample
- Install dependencies
npm install
- Start the web sample
npm start
- Navigate to http://localhost:1234
You may be need virtual printer if you don't have physical device. Fortunately there is Two Pilots Virtual Printer for windows and Cups PDF for linux
Comming soon