Barcode Fonts, Components, ActiveX and .NET Windows Forms Controls, Java Servlets, 
DLLs and Barcode Scanners. IDAutomation.com, Inc., Computers Hardware, Software & Services, Tampa, FLThis site chose the Norton Secured Seal to promote trust online with consumers. View your cart in the IDAutomation Store


Home > Font Encoders > JavaScript

JavaScript Font Encoders

Index:

Order a Developer or above package of IDAutomation's barcode fonts for the Javascript Font and Encoder Support for the Javascript Font and Encoder

JavaScript Integration

The JavaScript Font Encoders listed in Chart 1 are provided with a developer license to any of the IDAutomation Barcode Font Packages.

  1. Extract the files from the compressed zip file.
  2. Several files are provided for different barcode types (Symbologies) and purposes. Use the file that represents the symbology that is needed. This tutorial will use the Code 128 symbology, which is in the file named IDAutomation_Uni_C128.js. HTML example files are also provided and may be referred to as necessary.
    Two files are also provided for various purposes:
    1. symbology.js - the primary compressed file to use in production.
    2. symbology.uncompressed.js - the uncompressed source code of the primary file.
  3. Open the application or IDE where the barcode is to be integrated.
  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_Uni_C128.js"></script>
  5. Add a script where the barcode is to appear, which is the file name without the ".js":
    <script type="text/javascript">
    document.write(IDAutomation_Uni_C128(DataToEncode))
    </script>
  6. Modify "DataToEncode" to equal what is to be encoded in the barcode. This may be accomplished with a variable, a dynamically generated webpage or another product such as JQuery, which is used in this code example:
    <div id="Barcode_Font"> </div>
    <script type="text/javascript">
       $(document).ready(function() {    
       $("#encode").click(function(e) {      
       barcodetext = $("#datatoencode").val();     
       $("#Barcode_Font").html(IDAutomation_Uni_C128(barcodetext));   
    }); 
       });
    </script>
    JQuery is also used with the HRI object from this product in the GS1 Element String HRI Verification Tool.
  7. Display the result with the required barcode font to generate the correct barcode. This may be accomplished using CSS and Web Fonts or using CSS with locally installed fonts. For example, the following CSS and HTML format data to the font:
    <script language="JavaScript" src="IDAutomation_Uni_C128.js"></script>
    <style type="text/css">
    .barcodefont1 {font-family: "IDAutomation Uni M", "IDAutomationGS1 46"; font-size: 200%; }
    </style>
    ...
    <span class="barcodefont1"> <script type="text/javascript">
    document.write(IDAutomation_Uni_C128("www.idautomation.com"))
    </script> </span>
    ...
  8. Print or display the result to verify that the barcode is generated. If a scanner is needed to verify barcodes, IDAutomation offers several barcode scanners. It is normal to view some distortion of the barcode on the screen because of low screen resolution. However, the barcodes should be accurate when printed or viewed on high resolution screens.

JavaScript Encoders & Required Barcode Fonts

Chart 1. Available JavaScript Font Encoders.

Linear Font Encoders
Barcode Type JavaScript Font Encoder Required Font
Code-128 (Auto Mode) IDAutomation_Code128.js IDAutomationC128
Code-128 Sets IDAutomation_Code128a.js
IDAutomation_Code128b.js
IDAutomation_Code128c.js
IDAutomationC128
Code-39 IDAutomation_Code39.js, IDAutomation_Code39Mod43.js IDAutomationC39
Code-93 IDAutomation_Code93.js  IDAutomationC93
Codabar IDAutomation_Codabar.js IDAutomationCB
EAN-13 IDAutomation_EAN13.js IDAutomationUPCEAN
EAN-8 IDAutomation_EAN8.js IDAutomationUPCEAN
Interleaved 2 of 5 IDAutomation_ITF.js, IDAutomation_ITFMod10.js IDAutomationI25
UPC-A IDAutomation_UPCa.js IDAutomationUPCEAN
UPC-E IDAutomation_UPCe.js IDAutomationUPCEAN
USPS IntelligentMail (IMb) IDAutomation_USPS_IMb.js IDAutomationPOSTNET
or IDAutomationIMB
not applicable IDAutomation_SpliceText.js not applicable
not applicable IDAutomation_GS1_HRI.js not applicable
Universal, GS1 and DataBar Font Encoders
Barcode Type JavaScript Font Encoder Required Font
Code-128 IDAutomation_Uni_C128.js, IDAutomation_Uni_C128a.js, IDAutomation_Uni_C128b.js, IDAutomation_Uni_C128c.js IDAutomation_Uni
or IDAutomation_GS1
Code-39 IDAutomation_Uni_C39.js IDAutomation_Uni
or IDAutomation_GS1
Codabar IDAutomation_Uni_Codabar.js IDAutomation_Uni
or IDAutomation_GS1
Interleaved 2 of 5 IDAutomation_Uni_ITF.js IDAutomation_Uni
or IDAutomation_GS1
MSI / Plessey IDAutomation_Uni_MSI.js IDAutomation_Uni
or IDAutomation_GS1
USPS IntelligentMail IDAutomation_USPS_IMb.js IDAutomation_Uni
2D Font Encoders
Barcode Type 2D Function Methods | Notes Required Font
Data Matrix IDAutomation_DataMatrix.js IDAutomation2D or IDAutomationDMatrix
QR-Code IDAutomation_QRCode.js IDAutomation2D
PDF417 IDAutomation_PDF417.js IDAutomation2D or IDAutomationPDF417

Barcode Properties

Barcode properties may be modified within the top of the referenced .js file or by a function parameter.

Top of the .js file Example:
Top of the .js file Modification Example

Function Parameter Example:
Function Parameter Modification Example

The following is an explanation of popular properties:

Support

Support for the JavaScript Font and Encoder

View the release log for the JavaScript Font and Encoder

Free product support may be obtained by reviewing the knowledgebase articles documented below and by searching the resolved public forum threads. Priority phone, email and forum support is also provided via several contact methods within 30 days of purchase. Support after this complimentary period may be received with an active one year Level 2 Support & Upgrade Subscription for the corresponding font package.

Back to Top

 ©Copyright 2017 IDAutomation.com, All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us

Loading
Training Videos on YouTube  Join us on Google Plus  Join us on LinkedIn  Follow us on Twitter  Like us on Facebook
Over 70% of Fortune 100 companies use IDAutomation's products to automate their businesses.