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 quality #174

Closed
garygreen opened this issue Jul 12, 2017 · 8 comments
Closed

Barcode quality #174

garygreen opened this issue Jul 12, 2017 · 8 comments

Comments

@garygreen
Copy link

garygreen commented Jul 12, 2017

I'm currently generating a UPC barcodes in SVG (to be printed at an exact size in mm)
However when using a barcode verifier/quality scanner the barcodes always come out as a fail - the scanner grades the barcode quality by B to F grade.

image006

Any idea why this could be? The library seems to gear towards outputting the barcode on screen by defining the barcode widths in pixels - maybe this is a problem when you are outputting small barcodes or outputting to a specific size in mm because it's not precise enough?

Checking another tool https://www.jacoballred.com/barcode/index.php?code=021200300608&encoding=UPC-A&fg=%23000000&bg=%23FFFFFF&multiplier=0.5
This is defining the widths as inches and seems to be using a much finer decimal place.

@lindell
Copy link
Owner

lindell commented Jul 12, 2017

So you are using JsBarcode and printing the barcodes on a paper and then using that tool to verify? That should not be a problem.

What could (and will almost be guaranteed to) be a problem is if you try to specify a width on the entire barcode if the barcode is not very big since the one barcode line will be fractions of pixels.

@garygreen
Copy link
Author

garygreen commented Jul 12, 2017

See below for what we're trying to achieve... we print out a load of barcodes onto an A4 page that must be a fixed width / height as it's going to be cut up and printed on different tickets.

I suspect it is down to the height/width definitions conflicting with the height and width options that you supply to JsBarcode... I've played around with the preserveAspectRatio svg option but not had much luck with that, or the shape-rendering option.

https://jsfiddle.net/x6pq3a3w/1/

@garygreen
Copy link
Author

garygreen commented Jul 12, 2017

PS - At the moment we use a PHP library for generating the barcodes in PNG format with 4 times the resolution and scale it down, this gives us a good quality barcode under the same width / height as on that js fiddle example, it scans as grade B. However, as we put hundreds of barcodes on a printout it generates a huge filesize 300+ Meg, we generate thousands of files so obviously need a way to generate a barcode in SVG / vector format that scales well and gives just as good quality.

@lindell
Copy link
Owner

lindell commented Jul 13, 2017

Firstly, I can say with confidence that the width/height aspect has nothing to do with it.

Second, I did not get an answer on the question.

So you are using JsBarcode and printing the barcodes on a paper and then using that tool to verify?

And additionally, are you printing the PNG barcodes with the same size as the ones you generate by JsBarcode?

@garygreen
Copy link
Author

we print out a load of barcodes onto an A4 page

Yes we are then using a tool to verify the barcode quality.

@lindell
Copy link
Owner

lindell commented Jul 13, 2017

I'm sorry, I thought that was a description of what you was try to archive not the verification process.

In that case. Could you please take a picture of the both barcodes (the PHP one and the JsBarcode one) side by side so I can see how the barcode is getting warped?

Also, what is the tool you are using for verification? 🙂

@lindell
Copy link
Owner

lindell commented Jul 21, 2017

Is there any update on this issue?

@garygreen
Copy link
Author

I'm not much can be done here because the barcodes that are rendered are technically the same, have same widths etc I think it's just the nature of SVG rendering. Bit lost what to do tbh will probably just have to stick to rendering in PHP with PNG barcodes.

@lindell lindell closed this as completed Jul 21, 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