Native JavaScript Barcode Generator

 
Home Products Demos Support Integration Barcode FAQ Order Now Contact Us

 

Home:  Products:  Barcode Components:  Native JavaScript AJAX Barcode Generator:  User Manual

Native JavaScript AJAX Barcode Generator
Patent Pending

INDEX:

Product Overview

The Native JavaScript AJAX Barcode Generator is a script file that may be easily inserted into HTML and AJAX applications to create bar code images for display in HTML or text objects. Once implemented, no other components or fonts need to be installed to create barcodes; it is the complete barcode generator.

The Native Barcode Generator supports the following symbologies:

Barcode Integration Tutorial

Installing the Native JavaScript Barcode Generator is a fairly easy process. Several generators are provided for different bar code types.

  1. Extract the files from the package.
  2. Several generator files are provided for different bar code types. Use the file that represents the bar code type that is needed. If in doubt, IDAutomation recommends choosing Code 128 Auto, which is in the file named IDAutomation_JavaScriptBarcode_C128.js.
  3. Open the HTML document or application that the barcode is to be integrated with.
  4. Add the following line at the top of the file just before the </head> line to load the appropriate JavaScript file:
    <script language="JavaScript" src="IDAutomation_JavaScriptBarcode_C128.js"></script>
  5. Add a script where the barcode is to appear in the HTML document or text object, which is the file name without the ".js":
    <script type="text/javascript">
    document.write(IDAutomation_JavaScriptBarcode_C128(DataToEncode))
    </script>
  6. Modify "DataToEncode" to equal what is to be encoded in the barcode. This may be accomplished with a variable or a dynamically generated webpage.
  7. Print the result to verify that the barcodes are created properly and that they can be read with a scanner. If a scanner is needed to verify barcodes, IDAutomation offers several affordable, barcode scanner kits.
  8. Additional properties may be modified if necessary.
  9. Print the result to verify barcodes are being properly created. Ensure the object has been sized properly to contain the entire barcode. If the width of the barcode is larger then the area for it, several white lines will appear.
    Truncated barcode object
  10. It is normal to view some horizontal lines and distortion of the barcode on the screen because of low screen resolution. However, the barcodes should be accurate when printed.
    AJAX JavaScript Barcode
    If white lines appear after printing, select a mono-spaced font such as Courier New or Lucida Console at 3 to 5 points for the text field where the barcode image is returned. Additionally, the line spacing property may need to be adjusted to equal .8 or .9 lines.

 Properties and Symbology Options

All functions listed below are provided as a single JavaScript file preceded with IDAutomation_JavaScriptBarcode_.

Function Notes
C128(DataToEncode, BarHeight, XDimensionPoints, ApplyTilde) This is a "Code 128 Auto" function that will automatically encode any data from ASCII 1 to ASCII 127. It will automatically switch to character set C to encode numbers as necessary. To encode alpha-numeric UCC/EAN-128, ASCII 202 or character Ê is entered as the FNC1 before each AI. When any barcode begins with the FNC1, it automatically starts in Set C as required.
For example, the UCC number of (8100)712345(21)12WH5678 should be entered as a formula of:
IDAutomation_JavaScriptBarcode_C128 ("Ê8100712345Ê2112WH5678",6,4,
true)
or
IDAutomation_JavaScriptBarcode_C128 ("Ê" &
[Table1.DataField1] & "Ê" & [Table1.DataField2],6,4,true)
More information about AI's and UCC/EAN-128 is located here.

If ApplyTilde is set to True, the tilde will be processed. ApplyTilde is False by default in this function.

C128HR(DataToEncode, ApplyTilde) If creating Code 128 barcodes which need the text formatted, use this function. It is generally only used to format the text for UCC/EAN barcodes according to IDAutomation's Code128 Barcode FAQ. For example:
IDAutomation_JavaScriptBarcode_C128HR ("Ê" & "8100712345" & "Ê" & "2112345678"
,true)

If ApplyTilde is set to True, the tilde will be processed. ApplyTilde is True by default in this function.

C128a(DataToEncode, BarHeight, XDimensionPoints) Formats output to set A of Code-128. Use caution with this option because any lowercase character creates a function. Use the letter "i" for a tab and "m" for a return. For most purposes, it is better to use the C128() function instead of this one.
C128b(DataToEncode, BarHeight, XDimensionPoints) Formats output to Code-128, character set B. For most purposes, it is better to use the C128() function instead of this one.
C128c(DataToEncode, BarHeight, XDimensionPoints) This code128 function "interleaves" even numbers into pairs for high density. An even number of digits is required. For most purposes, it is better to use the C128() function.
C39(DataToEncode, BarHeight, XDimensionPoints, N_Dimension, IncludeCheckDigit) A MOD 43 checksum will be calculated if IncludeCheckDigit is true. For example: IDAutomation_JavaScriptBarcode_C39 ("123456789", 8, 3, 3, true)
Codabar(DataToEncode, BarHeight, XDimensionPoints, N_Dimension, StartChar, StopChar) StartChar and StopChar are also required as the start and stop characters. Valid start and stop characters are A, B, C and D.
I2of5(DataToEncode, BarHeight, XDimensionPoints, N_Dimension, IncludeCheckDigit) An even number of digits is required. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
MSI(DataToEncode, BarHeight, XDimensionPoints, N_Dimension, IncludeCheckDigit) Formats output for bar-coding in the MSI/Plessey symbology. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
Postnet(DataToEncode, IncludeCheckDigit) DataToEncode is a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
UCC/EAN-128 Barcode Examples for encoding UCC/EAN-128 Barcodes:
USPS EAN128 The following formula will create USPS_EAN128 in Code 128:
IDAutomation_JavaScriptBarcode_C128 ("Ê" & "912312214123442441134" & "~m19"
, 8, 4, true)
Where the number of 912312214123442441134 may be replaced with a data field, for example:
IDAutomation_JavaScriptBarcode_C128 ("Ê" &
[Table1.DataField1] & "~m19", 8, 4, true)
This number encoded is made up of the following: 2 digit service code + 9 digit customer ID + 8 digit sequential package ID + MOD 10 check digit. For more information, refer to the USPS portion of the Code 128 FAQ and the UCC/EAN portion of the Code128 Barcode FAQ.
SCC14 The following formula will create SCC14 in Code 128:
IDAutomation_JavaScriptBarcode_C128 ("Ê" & "013001234567890" & "~m13"
, 8, 4, true)
For more information, refer to the UCC/EAN portion of IDAutomation's Code128 Barcode FAQ.
SSCC18 The following formula will create SCC18 in Code 128:
IDAutomation_JavaScriptBarcode_C128 ("Ê" & "0000801234999999999" & "~m17"
, 8, 4, true)
For more information, refer to the UCC/EAN portion of IDAutomation's Code128 Barcode FAQ.

Description of the parts of the functions:

Technical Support

Common Problems and Solutions:

Other Barcode Software Products

IDAutomation has many other products to offer for barcoding purposes including:

.

Copyright © 2006-2007 IDAutomation.com, Inc. IDAutomation and BizFonts are registered trademarks of IDAutomation.com, Inc. All other trademarks mentioned are the property of their respective owners.

Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.