Build React Native App (4) - Redux, Jest, and NativeBase

Image
From this blog, typescript feature will be added. There are couple of ways to implement static type checking like; flow from facebook, PropTypes and Typescript. Typescript is well integrated with Visual Studio Code and supports better linter, error messages, and intellisense. Reference site Github Sample Ex4 Currnet version D:\GitRepo\reactnative>npm --version 6.3.0 D:\GitRepo\reactnative>react-native --version react-native-cli: 2.0.1 react-native: n/a - not inside a React Native project directory D:\GitRepo\reactnative>yarn --version 1.9.4 Creating React Native App $ react-native init ex4 If you want to specify the version, add "--version 0.57.3" at the end. Add NativeBase to React Native $ npm install native-base --save ... + native-base@2.8.1 added 71 packages from 42 contributors, removed 50 packages, updated 829 packages and audited 34989 packages in 138.542s found 0 vulnerabilities $ $ yarn yarn install v1.9.4 warning package-lock.json found. You

Generating EAN 128 (GS1-128) barcode manually from any editor using EAN 128 font

Generating EAN 128 (GS1-128) barcode manually from any editor using EAN 128 font

* If you like my article, please click AD on this blog. This will help me to motivate to keep up the posting. *

Reference

Prerequistic

  • font from idautomation: IDAutomationSC128M.ttf. The font is located at “IDAutomation_C128FontAdvantageDEMO\IDAutomation_C128FontAdvantageDEMO\Human Readable Fonts\Set C”

Generate barcode manually from Microsoft Word

EAN 128 is comprised of following structure

  1. Start code
  2. FNC Code
  3. Application Identifier(AI) code
  4. Data
  5. Repeating 3 and 4 to put multiple information into one barcode
  6. Check digit with MOD103 (remainder divied by 103)
  7. Stop code

If you look at the barcode per character, you will notice that 3 lines will be represent one letter or symbol except the stop code which is 4 lines.

To understand EAN-128 Code C, if you look at the USC Code-128 Character Set from the reference site, you will notice that all digits, alphabets, and symbols must be represented with two numbers.
Let’s look at the example of showing itemcode with Code C type. The itemcode must be numeric and we will be 14 digits for the itemcode(This length can be different depending on the specification) including check sum.

The length of itemcode will be 14 including check digit, so the itemcode should have 13 digists and 1 digit for the checksum. The itemcode for the example will be 0000010001000 which is 13 digits and checkdigit will be 8 for this itemcode. The final code will be 0000100010008 for the itemcode.

As I explained the format of EAN 128 Code C type, the format will be

  • Start C code: ASCII(0205)
  • FNC1: ASCII(0202)
  • AI code for the item: For the item, it is consisted with only number, to display barcode, we will need to group with two digists. In this case, 00 00 01 00 01 00 08. If you look at the USC Code-128, 00 will be ASCII(0194), 01 will be ASCII(0033), and 08 will be ASCII(0040). To use ascii code in Word, use ALT + Key_Value technique. To display 00 code for EAN 128, press ALT key, enter 0194 without releasing ALT, and release ALT after entering the number. You will see the barcode for 00. To display above
  • MOD103 Value: 89. ASCII(0121)
  • STOP code: ASCII(0206)

The method to calculate the MOD is in the reference site. In our case,

CODE C start c fnc1 34 31 31 33 31 33 31 41
Weight 1 1 2 3 4 5 6 7 8 9
Value 105 102 2 0 0 1 0 1 0 8
Weight*Value 105 102 4 0 0 5 0 7 0 72
Total 295
MOD103 89

MOD103 means remainder of 295 divided by 103.

EAN 128 Barcode Image Sample

Conclusion

As you saw this explanation, barcode line is consisted of 3 lines except STOP code which is 4 lines. To generate this right data using this method from SQL Report or other tool, you will need to write a code which reads string and translate it to EAN 128 format code. I hope this helps to understand how EAN 128 can be generated manually using any text editor with free font.

Comments

Popular posts from this blog

Export folder structure to file on Windows, Mac, and Linux

Build React Native App (4) - Redux, Jest, and NativeBase

Replacing text in PDF file using iTextSharp