Comments (6)
Thank you for using receiptline.
You can print with TM-T88V.
In order to print with the designer, please edit printer.json.
Then, type tm_series1
in the text box and send
.
"tm_series1": {
"host": "x.x.x.x",
"port": 9100,
...
},
The following code is an example of printing.
const net = require('net');
const receiptline = require('receiptline');
const data= 'hello, world!';
const printer = {
host: 'x.x.x.x',
port: 9100,
cpl: 42,
encoding: 'cp437',
upsideDown: false,
gamma: 1.8,
command: 'escpos'
};
const socket = net.connect(printer.port, printer.host, () => {
socket.end(receiptline.transform(data, printer), 'binary');
});
socket.on('error', err => {
console.log(err.message);
});
from receiptline.
Thanks.
I can work with this.
What is the best way of using the printers.json
file in the distribution?
Is this a list of example printers that can be supported with their settings?
from receiptline.
Instructions for printer.json
can be found in "ReceiptLine Designer" in README.md.
Most of the items are the same as the printer
parameter of the receiptline.transform()
method.
Thanks!
from receiptline.
@receiptline thank you for clarifying.
I am trying to translate this for browser and also have looked into the example en.html
file in this package.
I can render the receipt in browser but do not see a way to send to printer from browser.
The net
module is not available in browser only in nodejs. Is there an alternate way to send it to printer via IP?
Is there a complete browser print example I have overlooked in the package?
from receiptline.
How about the Web Serial API?
https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API
TM Virtual Port Driver
https://download.epson-biz.com/modules/pos/index.php?page=single_soft&cid=6481
// receiptline
const command = receiptline.transform(text, printer);
// navigator.serial
const port = await navigator.serial.requestPort();
// open the port
await port.open(options);
// get the writer
const writer = port.writable.getWriter();
// convert command string to Uint8Array
const binary = ...
// write Uint8Array
await writer.write(binary);
// close the writer
await writer.close();
// close the port
await port.close();
Thanks.
from receiptline.
Thanks.
from receiptline.
Related Issues (20)
- Question: How to send kick cash drawer command to printer? HOT 2
- リモートで店舗側のプリンタを印刷させるか HOT 4
- It's not working at gb18030 HOT 2
- more documentation HOT 3
- feature request: Zebra printer (ZPL) support HOT 1
- Better image processing support HOT 2
- Add TypeScript typings HOT 3
- Sending print jobs through AWS Lambda HOT 1
- Alignment Problem HOT 2
- [bug] A0 characters in the first line HOT 5
- Bluetooth thermal printer - PT-210 - Lines are not displayed correctly HOT 3
- Printing HTML code HOT 7
- Small font with ESC/POS - CPL: 32 -> CPL:42 HOT 4
- Star MC-Print3 CloudPRNT Opening Cash Register HOT 2
- Cannot use designer HOT 2
- printing Hebrew language
- Does it work for any brand connected the system
- Baud rate with the Serial-LAN Converter
- Open cash drawer on TSP143III HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from receiptline.