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

Strange behavior after barcode output. And other things #56

Closed
uyu423 opened this issue Aug 10, 2017 · 0 comments
Closed

Strange behavior after barcode output. And other things #56

uyu423 opened this issue Aug 10, 2017 · 0 comments

Comments

@uyu423
Copy link
Collaborator

uyu423 commented Aug 10, 2017

  1. The alignment or font size does not work properly after outputting the barcode. Are there any expected problems? And what exactly is the role of marginBottom? There is no margin under the barcode.
if (options.barcode) {
  const defaultBarcode = '100000000000'; // length 12
  const baseBarcode = `${defaultBarcode.substring(0, defaultBarcode.length - order.id.length)}${order.id}`;
  printer.align('ct').barcode(`${baseBarcode}${getParityEAN13(baseBarcode)}`, 'EAN13').marginBottom(20);
}

printer.align('rt').size(1, 1).text(moment().format('YYYY-MM-DD HH:mm:ss'), 'CP949');
printer.size(2, 2).cut();

image

  • Exception handling is likely to be needed for the length of the barcode string. If the length of the barcode parameter is not correct or there is a problem, it just does not print. It seems to require an error message.

  • I have a code for parity bit, which is the last bit of EAN13. Will Pull Request help?

song940 added a commit that referenced this issue Aug 12, 2017
Added utility to calculate EAN barcode type parity bit #56
@song940 song940 closed this as completed Sep 16, 2017
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

2 participants