Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Different output of 128B

79 views
Skip to first unread message

Priit Tamboom

unread,
Apr 2, 2012, 7:42:15 AM4/2/12
to ruby-...@googlegroups.com
Hi!

Thanks for creating Barby!

I'm buzzled about different output of 128B. I mean it's not only different in Barby but some online generators does have two different output.

Barcode: P4LX02633023004100A

First type output of 128B:
* Barby generated (see attachment)
* http://www.barcodesinc.com (example: http://goo.gl/EQpnG)

Second type output of 128B:
* http://barcode.tec-it.com/ (see attachment)
* barcode-generator.org

Do I miss something obvious?

Thanks!

Priit

128B.JPG

Tore Darell

unread,
Apr 2, 2012, 8:18:03 AM4/2/12
to ruby-...@googlegroups.com
The other barcode is a combination of B and C, here's the Barby equivalent:

Barby::Code128B.new("P4LX#{Barby::Code128::CODEC}02633023004100#{Barby::Code128::CODEB}A")

> --
> You received this message because you are subscribed to the Google Groups "Barby" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/ruby-barby/-/tEWxDoKIw_UJ.
> To post to this group, send email to ruby-...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-barby+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-barby?hl=en.
> <128B.JPG>

Priit Tamboom

unread,
Apr 2, 2012, 11:09:00 AM4/2/12
to ruby-...@googlegroups.com
Thanks, it solves the buzzle and works perfectly!

As barcode nuby, I definitely wouldn't figure out about mixing B and C in the same barcode.

Thanks, you made may day,
Priit

fruti saritha

unread,
Jun 1, 2012, 6:47:12 AM6/1/12
to Barby
Can u post ur code??

Priit Tamboom

unread,
Jun 1, 2012, 8:08:19 AM6/1/12
to ruby-...@googlegroups.com
Hi,

Sure, a bit simplified:

in controller (first_part, second_part, third_part is just string spited because barcode needs different code in the middle (second_part):

@barcode = Base64.encode64(Barby::Code128B.new(
    "#{first_part}#{Barby::Code128::CODEC}#{second_part}#{Barby::Code128::CODEB}#{third_part}"

And in view:
<img alt="" width='300px' src="data:image/jpeg;base64, @barcode).to_png(:height => 35)) %>"/>

Hope it helps you out,

Cheers,

Priit

reede, 1. juuni 2012 13:47.12 UTC+3 kirjutas fruti saritha:
Can u post ur code??

fruti saritha

unread,
Jun 1, 2012, 8:24:35 AM6/1/12
to ruby-...@googlegroups.com

I did not understand..please can you give clear explanation??

Thanks,
CH.saritha
Reply all
Reply to author
Forward
0 new messages