Native Windows Barcode Font Encoder DLL

The Native Windows Barcode Font Encoder DLL may be used in any application or development environment that calls a method from a DLL. This font encoder tool was written in C++ and has no COM or MFC dependencies. It may be used and distributed with an application when used with an IDAutomation barcode font. Redistribution of these fonts and components requires the purchase of a Developer License. 32 and 64-bit versions are provided. This product should only be used by advanced users and programmers with an understanding of how native Windows DLLs work. Consider one of IDAutomation's many font encoders as an alternative if this DLL will not work in your environment. This DLL does not use COM and cannot be registered as a COM object. If COM is desired, use the COM DLL.

The purpose of this DLL is to return a string formatted to a compatible IDAutomation barcode font. The Native Windows Barcode Font Encoder DLL contains methods for Code 3 of 9, ITF, Code 93, Code 128, UPC, EAN, GS1-128, all GS1 DataBar variants including Omni-directional, Stacked and Expanded Stacked, MSI, and USPS Intelligent Mail. This tool also contains methods for the GS1-128 Barcode FontGS1 DataBar Font, and the IDAutomation Universal Barcode Font Advantage™.

Download Now API Method List Barcode Fonts

Native Windows Barcode Font DLL API

The Native Windows DLL cannot return a string value and thus the return value will be passed as a variable to the method by reference. That said, there are a few differences between the Native Windows Barcode DLL and the methods listed.

The differences are as follows:

  • Return Value: The methods return 0 for success, or a non-zero value if the method fails.
  • Output: Passed by reference, this string value will be populated with the encoded data by the DLL.
  • Output Size: This integer value is populated by the DLL with the number of pertinent characters. It may be necessary to use this with the VB Mid Function as follows:
    BarcodeString= Mid(myOut, 1, iSize)

For example, in the General Declarations or in a separate module of a VB application or Excel spreadsheet VBA editor, the method needs to be defined:

Private Declare Function IDAutomation_Universal_C128_
Lib "IDAutomationNativeFontEncoder.dll" _
(ByVal D2E As String, ByRef tilde As Long, _
ByVal out As String, _
ByRef iSize As Long) As Long

The method can be called in a button-click event or in any other procedure. The DLL method needs an input parameter that can be filled by the DLL with the formatted data.

For example:

Public Function IDAutomation_Uni_C128(DataToEncode 
As String, Optional applyTilde As Boolean = False) As String
Dim myOut As String'Variable to be populated by DLL method with formatted data
Dim iSize As Long 'The size of the formatted data. Also, populated by the DLL
Dim lRetVal As Long 'Return value of the method. Will be zero if successful
Dim long_AT As Long 'variable to be passed to DLL determining if tilde processing should be done.
 
'Must be a long data type for DLL to accept
myOut = String(250, " ")
'The output variable needs to be sized to hold the data. The DLL can not dynamically size a variable
 
iSize = 0
If applyTilde = True Then
L_AT = True 'can be implicitly converted to a long
Else
L_AT = False
End If
 
'Call the method, passing in the data to encode, a boolean deciding if tilde
processing should be used, the output variable, and the variable that will be
populated with the size
 
lRetVal = IDAutomation_Universal_C128(DataToEncode, L_AT, myOut, iSize)
'Write out the output string, taking only the number of characters necessary
from the defined string
 
IDAutomation_Uni_C128 = Mid(myOut, 1, iSize)
End Function

The Native Windows Barcode Font Encoder DLL is supplied with an Excel example, which includes a VBA module. This module may be exported and used in VB 6, Microsoft Office, and other applications.

Copy the DLLs to the appropriate folder to activate the methods:

For 32-bit Windows, only the IDAutomationNativeFontEncoder.dll should be copied to %systemroot%\System32.

For 64-bit versions of Windows, 32-bit DLLs belong in SysWoW64 and 64-bit DLLs belong in System32.

  • IDAutomationNativeFontEncoder.dll > %systemroot%\SysWoW64
  • IDAutomationNativeFontEncoder64.dll > %systemroot%\System32

Native Barcode Font DLL Barcode Methods

The methods listed below are available in IDAutomation's DLL and are valid when used with the font listed in the Required Font column. The ReturnVal and Size parameters in the methods below are passed by reference. The ReturnVal is the encoded string to be used with the appropriate font; the Size variable is the size of ReturnVal.

Method Description Required Font Additional Notes
The methods in this section are preceded with IDAutomation_
long IDAutomation_Code128 (char *DataToEncode, long &ApplyTilde, char *ReturnVal, long &Size) IDAutomationC128 This is a "Code 128 Auto" method that will automatically encode any DataToEncode from ASCII 0 to ASCII 127. When ApplyTilde is equal to 1 or true, in Code 128 Auto, the format ~ddd may be used to specify the ASCII code of the character to be encoded, and several other tilde options are enabled.
long IDAutomation_Code128HumanReadable (char *DataToEncode, long &ApplyTilde, char *ReturnVal, long &Size) Any Text Font If Code 128 barcodes are being created which need the text formatted, this method may be used according to IDAutomation's Code128 Barcode FAQ.
long IDAutomation_Code128a (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationC128 In this method, the character values 64 through 95 from set A may be used to create methods when scanned. Formats output to the Code 128 barcode fonts.
long IDAutomation_Code128b (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationC128 Returns a string formatted to the Code 128 character set B. Formats output to the Code 128 barcode fonts.
long IDAutomation_Code128c (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationC128 This code128 method "interleaves" numbers into pairs for higher density.
long IDAutomation_Interleaved2of5 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationI25
or
IDAutomationHI25
This method "interleaves" numbers into pairs for high-density without check digits and formats the return string to the Interleaved 2 of 5 barcode fonts.
long IDAutomation_Interleaved2of5Mod10 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationI25
or
IDAutomationHI25
Performs the mod10 checksum calculation for increased accuracy and formats the return string to the Interleaved 2 of 5 barcode fonts. USPS requires MOD 10 checksums for special services and for SSC-14 when using Interleaved 2 of 5 for that purpose.
long IDAutomation_Code39 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationC39
or
IDAutomationHC39
Formats the output to print using Code 3 of 9 barcode fonts.
long IDAutomation_Code39Mod43 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationI25
or
IDAutomationHI25
Performs the mod43 checksum calculation for increased accuracy and then formats the output to print using Code 39 barcode fonts. The mod43 checksum is usually required for LOGMARS and HIBC applications.
long IDAutomation_Code93 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationC93 Formats the output to print with the 2 required check digits using Code 93 barcode fonts.
long IDAutomation_Codabar (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationCB Formats the output to print using Codabar barcode fonts.
long IDAutomation_UCC128 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationC128 This symbology option encodes an even number of digits and includes the FNC1 character in set C as required. Use Code 128 Auto to encode additional FNC1 codes or data containing text or odd numbers. Use the UCC128 method only for UCC-128 applications where the input data is an even number such as in SSCC-18 and SCC-14 barcodes.
long IDAutomation_MSI (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationMSI
or
IDAutomationHMSI
Formats output to the MSI Code barcode fonts.
long IDAutomation_UPCa (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationUPCEAN DataToEncode is a UPC-A number string of 11, 12, 13, 14, 16, or 17 digits with or without a check digit, add-ons are supported. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
long IDAutomation_UPCe (char *DataToEncode, char *szReturnVal, long &iSize) IDAutomationUPCEAN DataToEncode is a UPC-A number string of 11, 12, 13, 14, 16, or 17 digits with or without a check digit, add-ons are supported. The purpose of this method is to print the UPC-E barcode from a UPC-A barcode that can be compressed. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing "00005000000".
long IDAutomation_EAN13 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationUPCEAN DataToEncode is a number string of 12, 13, 14, 15, 17, or 18 digits with or without a check digit, add-ons are supported. Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
long IDAutomation_EAN8 (char *DataToEncode, char *ReturnVal, long &Size) IDAutomationUPCEAN DataToEncode is a number string of 7 or 8 characters (EAN-8 without the check digit). Formats output to the UPC/EAN barcode font. Entering incorrect data will create a barcode containing all zeros.
The methods listed below are preceded with IDAutomation_Universal_ and may only be used with the IDAutomation Universal Barcode Font Advantage Package.
The Methods in this section are all preceded with IDAutomation_Uni_
Method Description Required Font Additional Notes
long IDAutomation_Universal_C128 (char *DataToEncode, long &ApplyTilde, char *ReturnVal, long &Size) IDAutomation Uni This is a "Code 128 Auto" method 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_Uni_C128 ("Ê8100712345Ê2112WH5678", TRUE)
or
IDAutomation_Uni_C128 ("Ê" & {Table1.DataField1} & "Ê" & {Table1.DataField2}, TRUE)

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

long IDAutomation_Universal_C128HR (char *DataToEncode, long &ApplyTilde, char *ReturnVal, long &Size) Text Font If Code 128 barcodes are created which need the text formatted, this method may be used. It is generally only used to format the text for UCC/EAN barcodes according to IDAutomation's Code128 Barcode FAQ. For example:
IDAutomation_C128HR ("Ê" & "8100712345" & "Ê" & "2112345678", TRUE )

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

long IDAutomation_Universal_C128A (char *DataToEncode, char *ReturnVal, long &Size) IDAutomation Uni 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() method instead of this one.
long IDAutomation_Universal_C128B (char *DataToEncode, char *ReturnVal, long &Size) IDAutomation Uni Formats output to Code-128, character set B. For most purposes, it is better to use the C128() method instead of this one.
long IDAutomation_Universal_C128C(char *DataToEncode, char *ReturnVal, long &Size) IDAutomation Uni This code128 method "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() method instead of this one.
long IDAutomation_Universal_C39(char *DataToEncode, double N_Dimension, long &IncludeCheckDigit, char *ReturnVal, long &Size) IDAutomation Uni Formats the output for bar-coding in Code 3 of 9 with the universal font. A MOD 43 checksum will be calculated if IncludeCheckDigit is true. For example: IDAutomation_Uni_C39 ("123456789">, 3, TRUE )
long IDAutomation_Universal_Codabar(char *DataToEncode, double N_Dimension, char *CodabarStart, char *CodabarStop, char *ReturnVal, long &Size) IDAutomation Uni Creates Codabar (aka NW7) with the universal font. StartChar and StopChar are also required as the start and stop characters. Valid start and stop characters are A, B, C, and D.
long IDAutomation_Universal_I2of5(char *DataToEncode, double N_Dimension, long &IncludeCheckDigit, char *szReturnVal, long &Size) IDAutomation Uni This method "interleaves" numbers into pairs for high density without check digits and formats the return string to the universal font. An even number of digits is required. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
long IDAutomation_Universal_MSI(char *DataToEncode, double N_Dimension, long &IncludeCheckDigit, char *szReturnVal, long &Size) IDAutomation Uni Formats output for barcoding in the MSI/Plessey symbology. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
long IDAutomation_Universal_OneCode(char *DataToEncode, char *ReturnVal, long &Size) IDAutomation Uni
or
IDAutomationPOSTNET
or
IDAutomationIMB
This method formats a barcode for USPS Intelligent Mail and is compatible with the IDAutomation POSTNET font as well as the XS, S, or M size of the Universal Barcode Font. DataToEncode is a single string according to the Intelligent Mail Barcode FAQ.
Note: After the release of this product, the USPS renamed the OneCode Solution to the Intelligent Mail Barcode. The encoding of each is the same, only the name has changed. The selection of "OneCode" will generate the same barcode as "Intelligent Mail".
long IDAutomation_Universal_Planet(char *DataToEncode, long &IncludeCheckDigit, char *ReturnVal, long &Size) IDAutomation Uni Because this barcode type has a specific height requirement, this method only works with the XS, S, or M size of the Universal Font. XS is the normal version, S has the bars narrow by 10% and the M font has the bars narrow by 20%. 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.
long IDAutomation_Universal_Postnet(char *DataToEncode, long &IncludeCheckDigit, char *ReturnVal, long &Size) IDAutomation Uni Because this barcode type has a specific height requirement, this method only works with the XS, S, or M size of the Universal Font. XS is the normal version, S has the bars narrow by 10% and the M font has the bars narrow by 20%. 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.
long IDAutomation_Universal_UCC128(char *DataToEncode, char *ReturnVal, long &iSize) IDAutomation Uni This symbology option automatically encodes the FNC1 character in set C as required for UCC-128 barcodes. All methods of ApplyTilde are enabled in this method for calculating the required MOD 10 check digit and cannot be disabled, for example:
IDAutomation_Uni_C128 ("00000123455555555558" & "~m19" )
long IDAutomation_Universal_MODU10(char *DataToEncode, char *ReturnVal, long &Size) not applicable A MOD 10 check digit is returned. This is useful in calculating check digits for UCC/EAN 128 barcodes where a MOD check digit is needed. More information about UCC/EAN-128 is located here.
The methods listed below are preceded with IDAutomation_DataBar_ and may only be used with the IDAutomation DataBar Barcode Font.
The methods in this section are preceded with IDAutomation_DataBar_
Method Description Required Font Additional Notes
long DataBar (char *DataToEncode, char *ReturnVal, long &iSize) IDAutomation DataBar The 14 characters in GS1 DataBar are the 13 data characters plus an implied check digit. The check digit is not actually encoded in the barcode (as per the GS1 DataBar standards) but should be included as part of the DataToEncode parameter. If it is not known, a zero may be substituted.
long DataBarExpanded (char *DataToEncode, long &Segments, char *ReturnVal, long &iSize) IDAutomation DataBar This method is used for two symbologies, Expanded and Expanded Stacked. For Expanded barcodes set Segments to 22, for Expanded Stacked, Segments can be set to an even value in the range of 2-18.
long DataBarLimited (char *DataToEncode, char *ReturnVal, long &iSize) IDAutomation DataBar Refer to the DataBar Limited specification.
long DataBarStacked (char *DataToEncode, char *ReturnVal, long &iSize) IDAutomation DataBar Refer to the DataBar Stacked specification.
long DataBarStackedOmnidirectional (char *DataToEncode, char *ReturnVal, long &iSize) IDAutomation DataBar Refer to the DataBar Stacked Omnidirectional specification.

Method Descriptions

  • DataToEncode: A string value that represents the data being encoded.
  • N_Dimension: Determines the width of the wide bars, which is a multiple of the X dimension. Valid values are 2, 2.5, and 3. The default is 2. The X dimension is determined by the font point size.
  • IncludeCheckDigit: A Boolean value that determines whether a check digit should be automatically calculated and included for the DataToEncode.
  • ApplyTilde: When enabled in Code 128 with the Auto character set, the format ~ddd may be used to specify the ASCII code of the character to be encoded, and several other tilde options are enabled.