receiptline / receiptio Goto Github PK
View Code? Open in Web Editor NEWA print application for receipt printers, simple and easy with markdown, printer status support.
License: Apache License 2.0
A print application for receipt printers, simple and easy with markdown, printer status support.
License: Apache License 2.0
Looks like a great library, but missing TypeScript typings.
hi,
thanks for a very excellent application.
the concept is really great!!.
i have an xprinter which i want to connect to with receiptio on windows 10.
i am able to do test prints with windows os and the printer works fine.
but when i try connecting using xprinter it does not seem to work and i always get the disconnect(105) message when i try printing using receiptio whether on the command line or when using the library from a nodejs application.
i checked the list of supported printers but i noticed the xprinter series of printers wasn't supported.
is this support coming anytime soon or is there some sort of workaround around this.
thanks!!.
I would like to be able to test that the printer is online, without actually printing anything.
Great library! I'm personally only interested in generating digital receipts, without the need of the printer, through the API.
I wasn't sure which options actually allow to set the width and increase spacing, just like https://receiptline.github.io/designer/
? Would that be done through character limitation only? Also, is there a way to set a specific font during render (e.g., <span style="font-family:Papyrus; font-size:4em;">Thanks!</span>
)? I'm trying to make it look a bit more alike with the US & CA standard.
Hi,
In the industry I work on it is very common that ticket paper has a color brand stripe to the left side:
In order for the text not be placed over the stripe, some precautions should be taken.
My solution is to add a "margin" parameter ("-m") to receiptio, and then overwrite the "area" command accordingly:
const transform = async (receiptmd, printer) => {
// ...
// ...
if (printer.leftMargin) {
printer.command = Object.assign(
{},
typeof printer.command === 'object' ? printer.command : receiptline.commands[printer.command]
);
// overwrite area function
const a = printer.command.area;
printer.command.area = (left, width, right) => a(left + printer.leftMargin, width, right - printer.leftMargin);
}
return receiptline.transform(receiptmd, printer);
};
Also, the parameter cpl
might need to be adjusted.
i.e. with a cpl
of 48 and a leftMargin
of 2, will give a total width of 50, forcing the wrapping of every line.
So, when cpl
is not manually provided it should be adjusted:
cpl = default - leftMargin
I'm unsure this should be part of the receiptline or the receiptio tool. My implementation is on receiptio, but it might also fit as a general parameter in receiptline.
It could also be extended to right margin, of course.
Regards,
hi,
i kinda like the concept of this API. and my question is, can i connect to IWARE thermal printer that could connect with USB and/or Bluetooth with this API ? thx!
This command works flawlessly and prints. The printer is attached to a network.
"receiptio -d 192.168.1.60 -p generic receiptline.txt"
I tried to transfer the printer by plugging it in my system through USB.
"receiptio -d lpt1 -p generic receiptline.txt"
"receiptio -d USB002 -p generic receiptline.txt"
These commands returns "disconnect". How can I know the proper port/name of the printer?
This is the configuration of windows and the information stated in Device Manager.
Im on Windows 11 and the printer is a Generic 80mm Thermal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.