How to omit leading 0 from 128C barcode?

If I put 12345, for example, in a โ€œtextโ€ barcode property, the output is 012345.

This "0" is the problem. How can i remove this?

I am using Delphi 2010 and FastReport 4.9.72.

+4
source share
2 answers

The Code 128C font must be an even number of digits. This is by design.

There is a 1: 1 mapping between numbers and the resulting output, and the output is 2-bit. In case 1 , the 128C code representation of that number is 01

if the value was 12 , then the base view would be 12

therefore, the numbers 628 can only be represented by 0628

The wikipedia article on Code 128 explains the differences between 128A, 128B, and 128C encodings.

+10
source

To remove leading zeros from a string:

 function RemoveLeadingZeros(const S: String): String; var I, NumZeros: Integer; begin Len := 0; for I := 1 to Length(S) do begin if S[I] <> '0' then Break; Inc(NumZeros); end; if NumZeros > 0 then Result := Copy(S, NumZeros+1, MaxInt) else Result := S: end; 
+1
source

Source: https://habr.com/ru/post/1395624/


All Articles