barcode 128 charset B

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

barcode 128 charset B

Postby simonlec » Tue Dec 01, 2020 10:27 pm

Hi,
I need to generate a barcode in the 128 format with the charset B.
The charset B is required for my project.
How can I do this?

VpeCtrl.Barcode(1700, 262, 2000, 322, BCT_CODE128B, "123Abds", '');


OR
VpeCtrl.Barcode(1700, 262, 2000, 322, BCT_CODE128, "123Abds", '');

???
Thanks a lot
simonlec
 
Posts: 32
Joined: Wed Jul 30, 2008 6:50 pm

Re: barcode 128 charset B

Postby IDEAL Software Support » Wed Dec 02, 2020 10:11 am

The constants BCT_CODE128A, BCT_CODE128B and BCT_CODE128C are obsolete. They were used in very old versions of VPE, when an older barcode library was integrated. The constants are only there for backwards compatibility.

As written in the help file titled "Programmer's Manual":
Forced Switching of Character Sets

Whilst the barcode library switches the character sets (A/B/C) automatically as required, it is also possible to force characters to be coded in a given character set by using the following values as code selectors within the barcode text:

Character Set
Decimal
Hex

CODE A
192
0xC0

CODE B
193
0xC1

CODE C
194
0xC2


NOTE: For code C, two digits must follow, since digits in code C are encoded in pairs. If a code C selector is not followed by at least two digits, no barcode is drawn.

Example (C/C++ notation): "\xC0" "1" "\xC0" "2" "\xC0" "3"

Here, the CODE A is put in front of each digit (1, 2 and 3), so each digit is coded in the character set A.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: barcode 128 charset B

Postby simonlec » Wed Dec 02, 2020 2:26 pm

So, does a put the char(192) in the addcode parameter or only in the code parameter?

VpeCtrl.Barcode(1700, 262, 2000, 322, BCT_CODE128, "123Abds", '',String.fromCharCode(192));
or

VpeCtrl.Barcode(1700, 262, 2000, 322, BCT_CODE128, ,String.fromCharCode(192)+"123Abds", "");

I use vpe 7.1 with javascript in a old local intranet.

Thank a lot.
simonlec
 
Posts: 32
Joined: Wed Jul 30, 2008 6:50 pm

Re: barcode 128 charset B

Postby IDEAL Software Support » Wed Dec 02, 2020 5:34 pm

You will neeed v7.20 as there is a bug in v7.10 regarding Code-128 generation.

From the example in the help file titled "Programmer's Manual", you can see that you need to put the code-switch character in front of EACH character of the barcode string, this applies to the main text as well as the add-on text.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 5 guests

cron