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

Barcode width / height not working #26

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 2 comments
Open

Barcode width / height not working #26

GoogleCodeExporter opened this issue Mar 17, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Print barcode type UPC-A
2. Put any value in for width and height
3. Barcode always same size

Original issue reported on code.google.com by [email protected] on 15 Apr 2014 at 8:21

@GoogleCodeExporter
Copy link
Author

Hi timdiam,

Do you mind to tell me please what values are you trying for width and height 
of the barcode you want to print out?

Original comment by manpaz on 22 Apr 2014 at 12:30

@GoogleCodeExporter
Copy link
Author

It doesn't matter what values were provided because, aside from some broken 
range checks, your code ignores those parameters.

https://code.google.com/p/python-escpos/source/browse/escpos/escpos.py#178

(You're applying the height range check to the width value and vice-versa)

A bar width of 3 (\x03) and height of 100 (\x64) are hard-coded in constants.py

https://code.google.com/p/python-escpos/source/browse/escpos/constants.py#63

Since I just fixed it for my own use, here's the patch:

https://github.com/ssokolow/python-escpos/commit/b5f68f6895236207355efe6bc92c5b1
197948dc2

(Sorry about the different format. I fixed it after I rewrote constants.py to 
acknowledge that ESC/POS is intended to take the form of human-readable 
sequences similar to DOS ansi.sys escape codes.)

Original comment by [email protected] on 22 May 2014 at 5:24

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

No branches or pull requests

1 participant