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

Serialize arbitrary ASCII string into Code128 barcode? #20

Open
ratijas opened this issue Apr 13, 2021 · 4 comments
Open

Serialize arbitrary ASCII string into Code128 barcode? #20

ratijas opened this issue Apr 13, 2021 · 4 comments

Comments

@ratijas
Copy link

ratijas commented Apr 13, 2021

Currently Code128::new constructor expects valid Code128 byte data, where user must manually specify all the control codes to switch character sets as appropriate.

As a user, I'd rather leverage this conversion onto the library itself. I.e., I expect that I could pass any ASCII string to the constructor, and let it do the magic it needs. Unfortunately, I don't see any such functionality in this crate.

Alternatives

  • JsBarcode has auto-detection mode for Code128 input string.
@buntine
Copy link
Owner

buntine commented Apr 13, 2021

Thanks for the issue. 👍

Yeah, that's a nice enhancement. I'll look at adding it in the next version of the crate. I'll hopefully get onto it in the next week. I'm also open to PRs!

cheers,
Andrew

@ratijas
Copy link
Author

ratijas commented Apr 13, 2021

Not sure, if this relates to other barcode types. But probably there is a place for a layer of abstractions on top of it. I mean barcode formatted strings.

And for the Code128, the main challenge, as I see it, is that Code128 is able to represent the same data (output) in multiple ways (input strings). It results from the fact that any code page can encode digits and other common symbols. In short: there is no unique way to encode the data in Code128.

Not sure I'm up to the task, but it's nice to see the project moving :)

@ratijas
Copy link
Author

ratijas commented Oct 2, 2021

Hi, @buntine, what's up? Are you still open to PRs?

@jannschu
Copy link

jannschu commented Apr 10, 2023

I also needed this and implemented this in a new crate, code128 :-)

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