KA.Barcode for Java
Guide for Encoding Alphanumeric Data in Java Code 128
Complete Codabar source code to generate, print Code 128 images using Barcode Generator for .NET Control

Java Code 128 barcode generator: create, print barcode code 128 with checksum. Free Java example source code



Code 128 Generator for Java Overview
  • Encoding Code 128 valid data set to generate valid Code 128 images in Java applications
  • High quality Code 128 images may be printed with any printers, including those low resolution printers
  • Java Code 128 generation component supports rotating Code 128 image with 0, 90, 180, 270 angles
  • Simple to change the height of Code 128 barcode image with setting the Y(height of bar module) or imageHeight.
  • Provide professional features to set inter-character space and wide narrow bar ratio for Code 128
  • Compatible with JSP,J2EE and other web projects
  • Supports Java Reports software to set your wanted size of Code 128
  • Completely developed in Java for any operating systems with Java Virtual Machine.
  • Pre-configured industry standards Code 128 allow any untrained users to insert Code 128 in Java
Code 128 for Java Valid Character Set
Code 128 is also named as ANSI/AIM 128, Uniform Symbology Specification Code 128, USS Code 128.
  • all 128 characters of ASCII
  • values 128-255 in accordance with ISO 8859-1. There are referred to as extended ASCII.
Related Code 128 Java Generation Setting Guide
To solve all proper problem you may meet, Code 128 generator for Java provides other concerned Code 128 generation setting properties for adjust the image and size:
  • For more detailed information on how to set Code 128 image format, bar algiment, rotation, color in Java, Code 128 Java Image Setting is provided here;
  • For more detailed information on how to set Code 128 image height, image width, bar height, bar width, etc, Code 128 Java Size Setting is provided here.
Valid Data in Variable length for Encoding Code 128
Java Code 128 generator is compatible with encoding all 128 ASCII characters with variable data length as the following steps tells.
  • Install Java Code 128 generator and set up it;
  • Construct Code 128 object in Java;
  • Encode Code 128 valid data;
Sample as below,
barcode barcode = new Barcode();
barcode.setType(IBarCode.CODE39);
barcode.setCode("7894561223");
Three Character Sets for Code 128 in Java
During your generating Code 128 linear barcodes in Java, you may need to encode some special characters generate your target high quality Code 128 images. At this time, you need to set a specific data set with valid Code 128 data set as below:
  • Code 128 Set A - for encoding ASCII characters 00 to 95 (0-9, A-Z and control codes), special characters, and FNC 1-4
  • Code 128 Set B - for encoding ASCII characters 32 to 127 (0-9, A-Z, a-z), special characters, and FNC 1-4
  • Code 128 Set C - for encoding 00-99 (encodes each two digits with one code) and FNC1 encoding
For how to set in Java application, here is as below for each one.
Sample code as below:
barcode.setSymbology(Barcode.CODE128A);
barcode.setSymbology(Barcode.CODE128B);
barcode.setSymbology(Barcode.CODE128C);
processTilde for Code 128 Creation in Java
If you want to use the tilde character "~" to specify special characters in the input data, such as non-printable chars in ASCII table, you may need to set the processTilde to be true for Code 128 generation in Java.
barcode.setProcessTilde(false);
  • For 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126; Strings from "~256" to "~299" are invalid
  • For 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535) ; Strings from "~665536" to "~699999" are invalid