Barcode 128 with fonts + sample

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,492
edited 2014-01-08 in Download section
Barcode 128 with fonts + sample
With this font and encode function you can create a barcode in Navision.
The CODE 128 barcode is an alphanumeric barcode with a checksum. It is widely used an can be read by most scanners. The TTF is freeware.

Discuss this download here.


  • SorcererSorcerer Member Posts: 107

    there is a little problem while creating the barcodes.
    i want to generate a barcode for the string


    the result is


    which can not be displayed by the .ttf font...

    what can i do?
  • mariogomesmariogomes Member Posts: 1
    I downloaded the Barcode 128 fonts and everything is working fine with one exception.
    First, I created a barcode for Item No. TP057 to be scanned in the Navison Invoice. This works fine. What I would like to do next would be to create a Barcode as TP057<TAB>01<TAB>01 and when this barcodes is scanned, it should enter TP057 for Item No., 01 for Variant Code and 01 for Quantity. Those three columns are side by side and in the right order. The string to generate the barcode is:
    TAB = ”i
    RETURN = ”m

    If I scan the barcode in Notepad, it writes TP057 01 01 which means it is recognizing the TABs and everything is working fine, however in Navision it writes the whole string in the Item No. field as TP0570101 and it doesn't recognize the TABs. I tried the same thing using RETURN instead of TABs. and again it works in Notepad but the same thing happens in Navision.
    Does anyone know how to create a Barcode 128 for Navision that will fill in more than one field at once?

    Thank you!

  • Brian_DobsonBrian_Dobson Member Posts: 1
    Hi All,

    I'm the fellow that created the Code 128 Barcode Font listed above. I'm not sure I can be of any help in this forum, as I'm not overly familiar with Navision, but if I can be of help please feel free to contact me. In terms of this:

    the result is


    The ' character is encodable within the Code 128 specification. I suspect that character is not being fed properly to the script. Any Navision Gurus know why the ' would not be properly passed?
  • manifoldmanifold Member Posts: 7

    I'm having similar problems with this barcode function. It seems that the checksum character is not included in the bar code font.

    I'm not sure whether this is a problem with the function itself or the barcode font. Is it possible that the checksum character is e.g. "Ä", "Ö" or "Å"? If not, then the function itself is causing this error...

    Below is the code. The "ChecksumChar" variable probably gets a wrong character (eg. above mentioned Ä, Ö or Å)? Someone who is experienced with Navision programming should check if the code meets the barcode 128 standard. Unfortunately, I'm not so experienced :-/


    Timo Tasala


    FOR i:=1 TO STRLEN(pText) DO BEGIN
    Checksum := Checksum +(i*(currentchar-32));
    ChecksumChar:= Checksum MOD 103;
    ChecksumChar:= ChecksumChar+32;

    // convert SPACE to ALT+0128
    pText:=CONVERTSTR(pText,' ','€');


  • 2tje2tje Member Posts: 80
    I am having the following problem:

    The checksum can be a value between 32 and 135 (mod 103 + 32).
    Then why can I not print a checksum value between 129 and 135?
    (the following symbols are used: ‚ƒ„…†‡)

    Should I convert value higher than 128 or change other settings?
  • Dominus138Dominus138 Member Posts: 1
    2tje wrote:
    I am having the following problem:

    The checksum can be a value between 32 and 135 (mod 103 + 32).
    Then why can I not print a checksum value between 129 and 135?
    (the following symbols are used: ‚ƒ„…†‡)

    Should I convert value higher than 128 or change other settings?

    I had the same problem with this barcode font. Eventually I discovered through trial end error the correct mapping for 4 of the 6 values. However never could discover the last two chararcters....

    My solution to this was to purchase a barcode font which had it's mapping well documented. Adjusting the code for a Font of which the mapping is known is easy.

    I got the font from here:

    Hope this helps 8)
  • hiddentexthiddentext Member Posts: 45
    I tried running the sample report and I am getting rectangular boxes at the begining and end of the barcode.. What is that and how do I get rid of it.

  • michael_clarendonmichael_clarendon Member Posts: 2
    Please note the documentation that comes with this font appears to be a bit misleading especially when it comes to working out the correct checksum digits to show.

    For the record the start, stop, space and other characters appear to be incorrectly documented. Corrections are shown below;

    Code 128 Variant B Documented ASCII Equiv Actual ASCII Equiv
    0 {SPACE} (128) Ç (176) €
    95 DEL (145) æ (200) ‘
    96 FNC 3 (146) Æ (201) ’
    97 FNC 2 (147) ô (202) “
    98 SHIFT (148) ö (203) ”
    99 CODE C (149) ò (204) •
    100 FNC 4 (150) û (205) –
    101 CODE A (151) ù (206) —
    102 FNC 1 (152) ÿ (213) ¤
    103 START A (153) Ö (217) ™
    104 START B (154) Ü (218) š
    105 START C (155) ø (219) ›
    106 STOP (156) £ (220) œ

    Documentation says that to convert the 128 code to the ascii equivalent you need add 32 if your barcode < 95, or you add 50 if it is greater. It also says that barcode character 0 should be converted to 128.

    Only the bit about adding 32 appears to be correct.

    The original Navision code

    ChecksumChar:= ChecksumChar+32;

    Should be replaced with

    CASE ChecksumChar OF
    0: ChecksumChar := 176;//B0h
    1..94: ChecksumChar :=ChecksumChar+32;
    95..101: ChecksumChar := ChecksumChar+105;
    102: ChecksumChar := 213; //D5h
  • te6te6 Member Posts: 89
    Hi all,

    Thanks for giving this Download..

    I downloaded this report and am able to generate the report using the fonts given in this Download.

    But , It is not scanning in the Label area and also in the A4 sheet. and also am getting to boxes say like this am getting the generated barcode ]||||||||[.

    The Code Length to generate Barcode is around from 16 - 18.
    My code wiil be like this EX::PY00000RDLLGXXXX

    Please give me suggestions to resolve this Issue.
  • ara3nara3n Member Posts: 9,253
    you can try and use the following example and download the report.
    Ahmed Rashed Amini
    Independent Consultant/Developer

  • tasriptasrip Member Posts: 0
    ara3n wrote:
    you can try and use the following example and download the report.

    doesnt work folks... :(

    If I import this report and try it with Item."No." instead of Search Description and then I print a barcode, my barcode reader won't be able to read it. Plus it must be wrong because it looks not how it has to.
    Here you can check how it has to look like:

    I used the font attached i used other fonts nothing.

    maybe someone can help me :)
  • dule0612dule0612 Member Posts: 7

    i have a problem creating a 128 barcode with the sourcecode found in this topic:

    checked with both fonts: Code128bWin and Code128bWinLarge

    in 99,9% the created barcode is OK but in some cases it doesn't work:

    AA/L2.665 --> OK
    AA/L2.666 --> NOT OK
    AA/L2.667--> OK

    any ideas?

  • dule0612dule0612 Member Posts: 7
    i replaced the code

    //ChecksumChar:= ChecksumChar+32;

    CASE ChecksumChar OF
    0: ChecksumChar := 176;//B0h
    1..94: ChecksumChar :=ChecksumChar+32;
    95..101: ChecksumChar := ChecksumChar+105;
    102: ChecksumChar := 213; //D5h

    and it seems to work...
  • PinkyczPinkycz Member Posts: 17
    Has Anyone got this working please??
    I'm figting this for two days now and still unable to get a good read... The checksum calculation I've modified to the last post, but no progress.
    I suspect the problem is with start and end codes, often start and end characters shown as two boxes...
    The font enclosed in the package is comin from this site and the font table documentation shows that START B (C128B=104) should be value 154 and END (C128B=106) should have the value 156.

    The report restored at my end shows start and end characters as 'Ú' and 'Ü' while many of th eprevious post indicate these chars show as 'š' and 'œ'. I suspect this might be due to server locale that steps in and translates to local non-unicode codepage and my server has Traditional Spanish locale setup (I have experieced this problém in the past that some special chars were changing in our environment).

    Looking into the report at my system, I see that start and stop codes have hex values of DA and DC, ie. dec 218 and 220 respectively which does not match any of the value shown in the transformation table above and thus only confuses me...

    So I tried withvarious combinations of start and stop code to no luck.
    Have anyone been able to get this working and with what stop-start code values for Code128bWin font please??

    Thanks and regards,

  • tcapgontcapgon Member Posts: 1
    I replaced the written code by dule0612 with the next code and then it works:

    CASE ChecksumChar OF
    0 : ChecksumChar := 8364; // (Hex:20AC) (Alt+0128)
    1..94 : ChecksumChar += 32;
    95 : ChecksumChar := 8216; // (Hex:2018) (Alt+0145)
    96 : ChecksumChar := 8217; // (Hex:2019) (Alt+0146)
    97 : ChecksumChar := 8220; // (Hex:201C) (Alt+0147)
    98 : ChecksumChar := 8221; // (Hex:201D) (Alt+0148)
    99 : ChecksumChar := 8226; // (Hex:2022) (Alt+0149)
    100 : ChecksumChar := 8211; // (Hex:2013) (Alt+0150)
    101 : ChecksumChar := 8212; // (Hex:2014) (Alt+0151)
    102 : ChecksumChar := 732; // (Hex:2DC) (Alt+0152)

    Regards! Antonio.
  • dijogadijoga Member Posts: 1
    i have Troubles with this in NAV 2016 - the StartChar and the StopChar don't work. Is there any solution?
    Best Regards
  • Use the below

    Best regards,
    Tharanga Chandrasekara.
    For more info : NAV Community Blog |NAV General Blog]
  • AspkannanAspkannan Member Posts: 1

    Use the below

    Hi, after i compose the code 'š' change to 's' and 'œ' change to 'o' . how to fix get it work, please help.
  • MindeMinde Member Posts: 1
    Here is the working solution that handles characters of the whole set of 103 of possible check sum values. Code128 values 0 and 95..103 have been visually verified

    PROCEDURE EncodeBarcode128B@1000000032(pText@1000000000 : Text[250]) RetVal : Text[250];
    ChecksumCode128@1000000004 : Integer;
    i@1000000002 : Integer;
    currentchar@1000000003 : Char;
    ChecksumChar@1000000006 : Char;
    Code128@1000000005 : Integer;
    ASCII@1000000007 : Integer;
    SpaceChar@1000000001 : Char;
    //Barcode 128 variant B
    //to be used with following fonts ONLY: Code128bWin.ttf , Code128bWinLarge.ttf
    //fonts can be downloaded here

    ChecksumCode128:= 104;
    FOR i:=1 TO STRLEN(pText) DO BEGIN
    ChecksumCode128 := ChecksumCode128 +(i*(currentchar-32));

    ChecksumCode128 := (ChecksumCode128 MOD 103);

    CASE ChecksumCode128 OF
    0: ASCII := 8364;
    1..94: ASCII := ChecksumCode128+32;
    95 : ASCII := 8216;
    96 : ASCII := 8217;
    97 : ASCII := 8220;
    98 : ASCII := 8221;
    99 : ASCII := 8226;
    100 : ASCII := 8211;
    101 : ASCII := 8212;
    102 : ASCII := 732;
    103 : ASCII := 8482;
    ChecksumChar:= ASCII;

    SpaceChar:= 8364;
    pText := CONVERTSTR(pText,' ',FORMAT(SpaceChar));

    RetVal[1] := 353; //start Bar
    RetVal[STRLEN(RetVal)+1] := 339; //stop Bar
Sign In or Register to comment.