Barcode 128 lazarus / 39-Graphics ---------------------------------------------------------------------- mario9000 · 2011-10-16 15:38 I need a Code 128 barcode in CodeC and CodeB mode. I get it but it cant be decoded. Letter 1-2 are in CodeB     ( RR) Number 3-10 in CodeC      ( 12345678 ) Letter 11-16 are in CodeB ( 5DE200 ) (Mail-Tracking specification) Cane anybody help me? Code: [Select]  // Start mit B   vChecksum := 104;   result := Convert(StartB);    // Startcode   debug.add(FloatToStr(vChecksum) + ' - Start');   idx := Find_Code128AB(FText[1]);                           // 1 Buchstabe   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*1);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));   idx := Find_Code128AB(FText[2]);                           // 2 Buchstabe   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*2);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));   idx := 105;                                                // Code C   result := result + Convert(StartC);   Inc(vChecksum, idx*3);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum) + ' C ');   idx := StrToInt(FText[3]+FText[4]);                      // 3+4 Zahlen   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*4);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));   idx := StrToInt(FText[5]+FText[6]);                      // 5+6 Zahlen   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*5);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));   idx := StrToInt(FText[7]+FText[8]);                      // 7+8  Zahlen   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*6);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));   idx := StrToInt(FText[9]+FText[10]);                     // 9+10  Zahlen   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*7);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));   idx := 104;                                                // Code B   result := result + Convert(StartB);   Inc(vChecksum, idx*8);   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum) + ' B ');   for i := 11 to 16 do // RR      begin        idx := Find_Code128AB(FText[i]);        if idx < 0 then           idx := Find_Code128AB(' ');        result := result + Convert(tabelle_128[idx].data);        Inc(vChecksum, idx*(i-2));   debug.add(FloatToStr(idx) + ' - ' + FloatToStr(vChecksum));      end;   vChecksum := vChecksum mod 103;   result := result + Convert(tabelle_128[vChecksum].data);   debug.add(FloatToStr(vChecksum) + ' - Prüf');   result := result + Convert(Stop);      // Stopcode   debug.add('Stop'); ---------------------------------------------------------------------- BigChimp · 2011-10-16 17:57 What components are you using? I seem to remember an error with some barcode component when using the letter i (I think); you might have some luck searching the forum. (No experience with barcodes myself though) ---------------------------------------------------------------------- mario9000 · 2011-10-16 19:10 I've edit C:\lazarus\components\lazreport\source\barcode.pas to enable the switch between the code set while the creating. The problem was that i use the "Start C" command and not the switch command. It warks with: Code: [Select]  idx := 99;                                              // Code C   result := result + Convert(tabelle_128[idx].data);   Inc(vChecksum, idx*3); ---------------------------------------------------------------------- eddiecook · 2013-03-27 02:23 I think you may need to read this sentence carefully. It talks about the Code set shift issues of Code 128. This change applies to all characters following the Code Set character until either the end of the symbol, another Code Set character or the Shift character is encountered. (cite from ISO/IEC 15417:2007(E)8 ). Tags: Code 128 ---------------------------------------------------------------------- marcov · 2013-07-11 07:53 There are several free and paid for Lazarus and Delphi solutions that will probably be easier than porting/interfacing .NET components ---------------------------------------------------------------------- avra · 2013-08-14 06:49 Maybe this font could help: http://www.jtbarton.com/Barcodes/Code128.aspx or this Delphi component: http://www.torry.net/vcl/misc/barcodes/fbarcode.zip TurboPower SysTools for Delphi has barcode 128: https://sourceforge.net/projects/tpsystools There was an effort to convert SysTools Kylix version to Lazarus but barcode part was not included because of QT dependecies (which do not exist in non-Kylix version): http://wiki.freepascal.org/FpSystools