Extract the files from the installation package.
Several generator 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
HTML example files are also provided and may be referred to as necessary.
Additional files are also provided for various purposes:
symbology.js - the primary compressed file to use in production
that generates several image types including SVG, BMP and HTML5 and
offers several symbology options.
symbology.uncompressed.js - the uncompressed source
code of the primary file.
symbology.svg.js - this is a compressed file to use in
production when only SVG is required.
symbology.svg.uncompressed.js - the uncompressed source
code of the SVG generation file.
Open the application or IDE where the barcode is to be integrated.
Add the following line at the top of the file just before the
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:
If the default image type of SVG is not supported well within the application,
the ReturnType parameter may be changed to try
other images. Other Barcode properties
such as the bar height and X dimension may be changed if necessary.
Print or display the result to verify that the barcode is generated.
If a scanner is needed to verify barcodes, IDAutomation offers several
barcode scanner kits.
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.
Create a new project or open and existing project.
After a working project is created, the barcode generator may be
integrated within the
app. Note: IDAutomation does not support installation and set up of
PhoneGap, please use the tutorials provided by
Adobe choosing Help - Tutorials.
Edit the appropriate HTML file where the barcode is needed. In this
example \project\www\index.html is edited.
above from step 4, which will add the generator to the HTML file. In
this example, the following lines of code are used to integrate JQuery
with the barcode component to place an SVG image in the id element:
Install the PhoneGap Developer App on a mobile device and verify the
app works as intended.
Barcode properties may be modified within the top of the referenced .js file
or by a function parameter.
Function Parameter Example:
Top of the .js file Example:
The following is an explanation of popular properties:
XDimensionPoints - This
is the X dimension in pixels. Because the barcode is drawn in HTML5, each
pixel is about 10 mils or .026 cm. Refer to the
Barcode Resolution FAQ for more information and how to achieve a precise
X dimension that is not in increments of 10 mils or .026 cm.
BarHeight - The height of the bars in pixels. Each
pixel is about 10 mils or .026 cm.
ReturnType - The ReturnType
parameter may be changed to return images other then the default of SVG.
This may be necessary if the SVG image does not produce the desired result.
0 = SVG (Default).
1 = BMP Image; when the X Dimension is set to 1, the BMP images
may appear to have clearer HR text.
2 = HTML5 Canvas; HTML5 images may appear blurry on some devices
when XDimensionPoints is a number less
3 = Font Image; generates a symbol from text using a mono-spaced
system font. This may be necessary when the other image options do not
work. XDimensionPoints will need to
be increased to about 6 or 8 when using this option.
ApplyTilde - Processes the tilde character for special
functions such as encoding functions, encoding ASCII characters directly
IDElement - is an optional parameter that can place
the returned image into the referenced div id element.
GS1 Encoding Options
- The FNC1 may be encoded with ~202 in Code 128 and ~1 in
GS1-QRCode when the tilde option is enabled. The FNC1 may also be encoded by
surrounding the AI in parentheses in Code 128.
HRI Options - When using
the HRI object, multiple GS1 fixed length element strings are
automatically displayed. Examples: GS1-128
Tilde MOD Options -
enabling ApplyTilde or ProcessTilde will allow the following modulus calculation options where ??
is the number of digits before the tilde to include in the calculation:
~m?? calculates a MOD10 check character, commonly
used for GS1. Example: ~2020000801234999999999~m17 Encodes: (00) 008012349999999997
~f?? calculates a MOD43 check character, commonly
used for HIBC. Example: +A123BJC5D6E71~f14
~i?? calculates a MOD37-2 check character,
commonly used for ISBT. Example: G123412654321~i13
~k?? calculates a MOD37-2 check character in brackets,
commonly used for ISBT manual entry. This option will not encode the check
character within the barcode and should only be used with the
HRI object. Example:
G123412654321~k13 Displays: G123412654321 [L]
Tilde ASCII Encoding -
ASCII functions and characters may be directly encoded with
~??? in Code 128 and ~d??? in Data Matrix and
QR Code where ??? is a 3 digit number of the ASCII code.
If scanning problems are encountered with printed output, verify the
barcode symbol is not truncated and that a printer of 600 DPI or greater
is being used. A larger X dimension may
be used with low-resolution printers to create more accurate symbols. If
the proper resolution cannot be achieved, IDAutomation also offers many
barcode fonts that
print well to
The Font Image option may be use to display a barcode image in a text
box or field. In this case, the font selected for the text object should
be "Courier New", "Lucida Console" or another mono-spaced
unicode font. Additionally, ensure the barcode can fit in the object. If
the width of the barcode is larger than the object, several white lines