[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override/extend printer implementations #15

Open
IlyaSemenov opened this issue Aug 31, 2021 · 3 comments
Open

Allow to override/extend printer implementations #15

IlyaSemenov opened this issue Aug 31, 2021 · 3 comments

Comments

@IlyaSemenov
Copy link

I would like to use my own open() for a ESC/POS printer that I work with.

However, all implementations live in a closure and there is no way to extend or provide an override.

I would expect at least something simple as:

const receipt_data = receiptline.transform(doc, {
	encoding: "cp866",
	command: "escpos",
	commands: {
		open: function (printer) { return "..." }
	},
})
@receiptline
Copy link
Owner

Thank you for your feedback.

The command object interface was closed and experimental, but now it is stable.

We will consider extending the command object by users.

@techmunk
Copy link

I think this would be fantastic! I have an Xprinter that supports ESCPOS, but does not have the "Buzzer" like an Epson printer might, or at least does not understand the command FS ( A pL pH fn m. The print works, it just prints AOC at the start of every receipt. Using sii removes that issue, but barcodes no longer work.

I can work around this with string manipulation, but it would be nice to have more control for some of the generic brand printers that are ESCPOS compatible.

@receiptline
Copy link
Owner

Hello!

We have just released receiptline V1.7.0.

Printer implementations are now public. receiptline.commands.*

You can now override/extend printer implementations.

Please see receiptline/example/command/custom.js.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants