Single barcode with Code128B and Code128C with iTextSharp
I wish to generate a barcode mixing code128B and code128开发者_JAVA技巧C with iTextSharp DLL. Do you know how to do that ? I currently know only with a single codeset.
By example, I wish to generate a barcode with the value 8L1 91450 883421 0550 001065 where "8L1 91450" is in code128B and "883421 0550 001065" is in code128C.
Thanks
Barcode128
will actually automatically switch from B
to C
if and when it can but it sounds like you don't want this. For the control that you're looking for you'll need to set your barcode's CodeType
property to Barcode.CODE128_RAW
and manually set the raw values.
There's a couple of posts out there that give the basic idea but unfortunately they tend to assume to much knowledge of iText or too much knowledge of barcodes.
I'm not a barcode expert either but the basic idea is to create a string that starts with Barcode128.START_B
, then the first part of your text, then Barcode128.START_C
and then the second. When in raw mode, text isn't ASCII, however. You can use this site to get the character codes for various ASCII values. But basically instead of sending the letter L
you'd send (char)44
.
Hopefully this gets you started at least.
精彩评论