IDAutomation.com, Inc.

Your Source for Quality Symbology

[IDAutomation.com Home Page]

Home:  Products:  PDF417 Barcode Font and Encoder  PDF417 Font and Encoder FAQ & Support Manual:

IDAutomation PDF417 Font and Encoder Manual

A license is required for each computer this software is installed on;
this software may only be used according to the License Agreement.

How to use:

FAQ - Frequently Asked Questions: Support Issues and Specifications:
  PDF417 FAQ (Frequently Asked Questions)

If PDF417 is implemented as a font, why can't I just select the font and type data to create the symbol?

The implementation of PDF417 as a font consists of both the encoder and the font. The purpose of the encoder is to convert the data to be encoded into proper bar and space patterns formatted to our PDF417 barcode font. It is necessary to use the encoder because of the complexity of the symbology and the required Reed Solomon error correction. 

What are the benefits of printing PDF417 as a font?

The benefits include high scalability with operating system, application and printer independence. These are best described in our Font Quality Statements

Can I encode and scan extended characters such as © ® ë ö ?

The answer is yes! It is possible to scan and encode extended characters provided you do the following:

  1. Encode the data using BASE256. This option encodes ASCII 1 to 255 of the ASCII character set. When encoding over 1024 characters of data, ASCII 127-160 must also be encoded in the format ~ddd as described here.
  2. Scan the data via the serial interface option (data bits have to be 8N) on your scanner. Normally, keyboard wedges and USB scanners do not support extended characters above ASCII 128 and they only can scan characters that are actually on the keyboard. Contact your scanner vendor for more information on how to do this; you may have to modify some settings internal to your scanner.
Performing a Word mail-merge using Excel as the data source

PDF417 barcodes can be created in a Word mail-merge if Excel is used as the data source with the following procedure:

  1. Install the PDF417 Font Encoder for Windows.
  2. Place a title in each column of the spreadsheet on row 1 that will contain the data, then import the data into the Excel spreadsheet.
  3. Select a blank column on row 1 to the right of the last populated column in the spreadsheet and title it Barcode.
  4. Choose Tools - Macro - Visual Basic Editor.
  5. Choose Insert - Module; copy and paste the following into the new module:
    Public Function EncPDF(DataToEncode As String, EcLevel As Integer, TotalColumns As Integer, TotalRows As Integer, Truncated As Integer, PDFMode As Integer, ApplyTilde As Integer) As String
    Dim PDF417FontEncoder As PDF417Lib.PDF
    Set PDF417FontEncoder = New PDF
    PDF417FontEncoder.FontEncode DataToEncode, EcLevel, TotalColumns, TotalRows, Truncated, PDFMode, ApplyTilde, EncPDF
    End Function
  6. Choose Tools - References and select the IDAutomation PDF417 Barcode and choose OK.
  7. Close File - Close and return to Excel.
  8. Add a formula on row 2 of the Barcode column that calls the EncPDF function and add the cells of data you wish to encode in the formula.
    For example, the following formula adds columns A and B to the barcode:
    =EncPDF((A2&B2),0,0,0,0,0,0)
    the following formula adds just column A to the barcode:
    =EncPDF(A2,0,0,0,0,0,0)
    the following formula adds columns A, B and C to the barcode and separates them with a comma delimiter:
    =EncPDF((A2&","&B2&","&C2),0,0,0,0,0,0)
  9. Highlight the cell with the formula in it and choose Edit - Copy.
  10. Select the entire range of cells to paste this formula into in the Barcode column and choose Edit - Paste.
  11. Follow the procedures in Word to add this spreadsheet as your data source the mail merge.
  12. Add the mail merge field of Barcode where you wish to place the barcode in the document.
  13. Highlight the «Barcode» merge field and select the IDAutomationPDF417 font.
  14. After you perform the mail-merge, the barcodes should appear in the merged documents.
  15. If you have problems or would like to see a working example, open the Word Mail-Merge.doc file which is in the program folder under c:\Program Files.
Using the VBA macro with MS Access

This is an example of using the PDF417 encoder with multiple fields using our sample database.

NOTE: The ActiveX Control provided in this package is easier to use in Access than the VBA macro with the font. Information about using this control is provided at the ActiveX Control Webpage and in the access example.

  1. Open our Access 2000 Barcode Example Database.
  2. Select the Reports object, and go into Design mode of the "Barcode Report Using PDF417 Font" report.
  3. Select the field on the left, in the detail section, directly underneath the label that states "Barcode:"
  4. Bring up the properties window for the field that you selected, if the properties window is not already displayed. You can display the window by right clicking the text box and selecting Properties.
  5. Select the All tab in the property window. You will notice a property named Control Source which contains the following:
    =EncPDF([TestData.data],0,0,0,0,0,0). This is the function that encodes the data in preparation for font application.
  6. Modify the Control Source property so that it reads: =EncPDF([TestData.data]+[TestData.NumberData],0,0,0,0,0,0).
    (The new information is in bold.)
  7. You may also add functions such as tabs and returns between the fields of the database. This example inserts a tab between the fields:
    =EncPDF(([Test Data.TextData] & "~009" & [Test Data.NumberData]),0,0,0,0,0,1)
Importing DLL module into Excel or Access
  1. Open Excel or Access Example that came with your download (open in Design Mode in Access).
  2. Go to Tools - Macro - Visual Basic Editor. Open the project, then the module and the "DLLfunctions" module.
  3. Copy the DLL function source code on the right hand side and paste it into your notepad for future use.
  4. Open the new Excel or Access that you would like to import the module into.
  5. Go to Tools - Macro - Visual Basic Editor of the new project or spreadsheet.
  6. Go to Tools - References and select IDautomation PDF417 Barcode, click ok.
  7. Go to Insert - Module and paste the DLL function source code on the right hand side.
  8. Save and then close. (You can rename the module at that time if you choose)
Using the COM DLL font encoder
Step1: Install the Font and Encoder for Windows. This is the INSTALL_PDF417.EXE file in the ZIP file. Upon execution, it installs TrueType fonts, implementation examples and registers the DLL. To register the DLL manually, perform the following: (1) copy the DLL to the \System directory; (2) Register the DLL by going to the command prompt, change to the \system directory, and type the following command: REGSVR32 "IDAutomationPDF417e.dll".

Step2: After registering the DLL, you can reference it from within your application. Refer to your application's documentation to find out how to do this. In Microsoft Office Visual Basic and Visual Basic 6.0, you need to choose Tools - References or Project - References and select the "IDAutomation PDF417 Barcode". Then reference the class and function in your application, as in the code below, which is used in the Access, VB and Excel examples provided with the installation:

  'Create a Visual Basic function to call the DLL from within your application
Public Function EncPDF(DataToEncode As String, EcLevel As Integer, TotalColumns As Integer, 
    TotalRows As Integer, Truncated As Integer, PDFMode As Integer, ApplyTilde As Integer) 
    As String
    Dim PDF417FontEncoder As PDF417Lib.PDF
    Set PDF417FontEncoder = New PDF
    PDF417FontEncoder.FontEncode DataToEncode, EcLevel, TotalColumns, TotalRows, Truncated, 
    PDFMode, ApplyTilde, EncPDF
End Function
  'Then, in your application, format the Output by calling the function, for example:
  'In Visual Basic code:
Output = EncPDF(DataToEncode, "0", "0", "0", "0", "0", "0")
  'In an Excel formula, data pulled from cell A3:
=EncPDF(A3,0,0,0,0,0,0)
  'In a Microsoft Access control source formula:
=EncPDF([table.field],0,0,0,0,0,0)
  'Placing a tab function between fields in a Microsoft Access control source formula
  'to encode more data in a single PDF-417 symbol. Be sure to set ApplyTilde to "1" also.
=EncPDF(([Test Data.TextData] & "~009" & [Test Data.NumberData]),0,0,0,0,0,1)
  'In Visual Basic you may also call the DLL directly, for example:
Dim Output as String
Dim PDF417FontEncoder As PDF417Lib.PDF
Set PDF417FontEncoder = New PDF
PDF417FontEncoder.FontEncode DataToEncode, 0, 0, 0, 0, 0, 0, Output
  'The "Output" string contains the returned code
A Visual Basic project example is included with the package. These files are placed in the destination directory upon installation.

API and barcode functions for the COM and .NET DLLs

FontEncode Function for COM DLL:

FontEncode (DataToEncode As String, EcLevel As Integer, TotalColumns As Integer, TotalRows As Integer, Truncated As Integer, PDFMode As Integer, ApplyTilde As Integer, Output as String) The fields that use this function and PDF417 font must accept returns and multiple lines. Enter zeros for defaults in all integer fields, for example, in the COM DLL:
PDF417(InputString,"0","0","0","0","0","0",OutputString)  

FontEncode Function for .NET DLL:

Variable=FontEncoder (DataToEncode As String, EcLevel As Integer, TotalColumns As Integer, TotalRows As Integer, Truncated As Boolean, PDFMode, ApplyTilde As Boolean) Example:
TextBox2.Text = NewBarcode.FontEncoder(DataToEncode, 0, 0, 0, False, PDF417Barcode.PDF417Modes.Text, True)
How to use the .NET Control in .NET applications
The .NET DLL and Forms Control is included in the directory named "Dotnet DLL and Forms Control" in the ZIP file. It contains a simple project that performs the steps 1 and 2 below. It can also be used as a graphics object as described below.

An example using the Encoder to obtain the data that when printed with our PDF417 Font, will create a correct barcode:

Step1: In your project, add a reference to the DLL and place the import statement in the declarations section of your project. For example:
Imports
IDAutomation.Windows.Forms.PDF417Barcode

Step2: The following code will obtain the data to encode and place it in the TextBox. This data, when printed with our PDF417 Font, will create a correct barcode:
Dim
NewBarcode As PDF417Barcode = New PDF417Barcode()
TextBox2.Text = NewBarcode.FontEncoder(TextBox1.Text, 0, 0, 0, False, PDF417Barcode.PDF417Modes.Text, True)

For information about printing from the .NET Forms Control without using the font, please refer to our online Forms Control Manual.

For information about the ASP.NET Web Control, please refer to our online ASP.NET Web Control.

Barcoding with the PDF417 Java class font encoder

How to format data to the barcode font using the Java class library:

Step1: First, you must have a Java 1.1 or greater virtual machine installed on the computer that is to format the data. Copy everything in the "Java Class Encoder" directory to the root directory of your computer's class path. If you don't know what the root is or need assistance in this area, consult the Java documentation or the company you obtained the Java virtual machine from.

Step2: After the directories are copied to the class root, the method to format data to the font can then be called from a method in a Java application as in this example:

import java.io.*;
import IDautomationPDFE.*;
class PDFTest
{
    public static void main ( String [] args )
    {
        String dataToEncode = "This is a test of the IDAutomation.com PDF417 Java Encoder.";
	PDF417Encoder pdfe=new PDF417Encoder();
	System.out.println( pdfe.fontEncode(dataToEncode) );
    }
}

The data string returned by the FontEncode method will create a proper PDF417 symbol when displayed or printed with the PDF417 font. To install the font on your operating system, consult your OS documentation or follow our font installation procedures.

This section explains the main configuration parameters and methods of the PDF417 for Java encoder class.

For detailed information on PDF417, please review the PDF417 FAQ.

Distributing files for an application

If you have purchased a Developer License for the PDF417 Font and Encoder, you may distribute the font files and applicable components with your application. In addition, if you purchase 3 Developer Licenses and have signed the source code license agreement, you may integrate the source code directly into your application, eliminating the need to distribute DLLs. The source code is available in VB, C++ and Java. Remember to have your application register the DLLs after they are copied to the system folder.

NOTE: Redistribution of our fonts and components requires a Developer license.

Windows Encoder COM Files (We recommend using an advanced installation application to distribute files for Windows)
Purpose of File File to Distribute Notes
Font File IDAutomationPDF417n3.ttf The PDF417 TrueType font. You may also distribute any other font files in the package as necessary.
Encoder DLL IDAutomationPDF417.dll This is the encoder DLL that formats the PDF-417 font. It can be found in the system directory after installation. Because it was created with C++ ATL, it is small and has no dependencies.
Windows Encoder .NET Files (We recommend using an advanced installation application to distribute files for Windows)
Purpose of File File to Distribute Notes
Font File IDAutomationPDF417n3.ttf The PDF417 TrueType font. You may also distribute any other font files in the package as necessary.
Encoder DLL idautomation.pdf417.dll This is the encoder DLL and forms control. It requires the .NET Framework 1.0 or greater.
Java Encoder Files for UNIX and Other Systems.
Purpose of File Files to Distribute Notes
PDF417  Java Class Library PDF417Encoder.class These files must exist in the IDautomationPDFE directory from the class path because IDautomationPDFE is the package name.
Font File <depends on OS> Our PCL and PostScript fonts are commonly used on UNIX systems.
Crystal Reports UFL Encoder Files (We recommend using an advanced installation application to distribute files for Windows)
Purpose of File File to Distribute Notes
Font File IDAutomationPDF417n3.ttf The PDF417 TrueType font. You may also distribute any other font files in the package as necessary.
Encoder DLL IDAutomationPDF417.dll This is the encoder DLL that formats the PDF-417 font. It can be found in the system directory after installation. Because it was created with C++ ATL, it is small and has no dependencies.
VB Runtime DLL msvbvm60.dll This runtime file already exists on most PCs and it is required for the Crystal UFL. It can be found in the system directory after installation.
Crystal Runtime U2lcom.dll This is a crystal runtime file that is required to work with UFLs.
Crystal UFL CRUFLidautomationPDF.dll The IDAutomation Crystal UFL. It can be found in the system directory after installation.

NOTE: Redistribution of our fonts and components requires a Developer license.

PDF417 Issues and Solutions

Line Spacing Issues (too much space between each line)

Some implementations of PostScript fonts can cause a small space to appear between rows in the symbol. The only way to overcome this issue is to make sure your printing application is not adding additional line feeds or in the case of PCL fonts, change the vertical motion index as indicated below. This space will not cause problems with scanners and the barcode will still be readable.

When using 12 or 14 point PCL fonts, an adjustment to the vertical motion index is not usually necessary. However, if you are using other sizes, you may need to adjust it to close the gap between rows. To set the vertical motion index, issue the command before printing with the PDF417 font. The code for the vertical motion index Command is escape "<Ec>" + "&" + lowercase L "l" + Number Index + Capital "C". Use the chart below to find the command for your font size. The number may be adjusted as necessary for your printer.

PCL Font Point Size Vertical Motion Index Command to Use
10 <Ec> &l6.5C
8 <Ec> &l5.2C
6 <Ec> &l3.9C

In the example above, the <Ec> represents the escape character for your software. In DOS Edit, Ec is represented by holding down the CTRL key and pressing the letter P, releasing both keys and then press the ESC key. 

X Axis Issues or Left Margin Alignment Issues

This issue may exist if you try to move the barcode to the right on the X axis using a programming language, such as Visual Basic. When using the printer.currentX specification to set the X axis, only the first line of the barcode would print in the new position and the remaining lines would print at zero (all the way to the left). This is because the printer.currentX specification is reset every time a return is performed. A return must be performed to print the font on the new line.

The best solution to this problem would be to find a command that could move the left margin so that returns will move the insertion point to the correct position. Since Visual Basic does not have a command like this, a small piece of code must be written to set the currentX for each line.

Step 1. Declare and initialize a variable with the desired X position. Example:  my_x = printer.currentX

Step 2. Replace the "Printer.Print OutputString" command with something similar to the following:

For i = 1 To Len(Output)
   out1 = out1 & Mid(Output, i, 1)
      If Mid(Output, i, 1) = Chr(10) Then
         out1 = Replace(out1, Chr(10), "")
         out1 = Replace(out1, Chr(13), "")
         Printer.CurrentX = my_x
         Printer.Print out1
         out1 = ""
      End If
Next i
Use With Crystal Reports
Notice for users of Crystal Reports prior to version 9: This UFL is designed to work with Crystal Reports 6.0 and above. However, because of a Crystal Reports limitation in older versions, those prior to V9, you can only encode limited information (up to about 40 ASCII characters or 30 binary characters, which allows up to 254 characters in a string) with the ECC level set to 1 and the number of columns set to 10. Up to about 50 ASCII characters can be encoded if the truncate option is selected, as shown in this example formula:  IDAutomationPDF417EncoderPDFSet({Table.Field}, 1, 10, 0, 1, 1, 0 ). If the PDF417 symbol exceeds 10 columns or 3 rows, the barcode will be damaged because of the formula truncation. To overcome this limitation, you must upgrade to version 9. How the IDAutomation.com PDF417 Font and Encoder works with Crystal Reports:
  1. After installing the PDF417 Font and Encoder for Windows, you will be able to use the IDAutomationPDF417Encoder functions in Crystal Reports.
  2. The IDAutomationPDF417EncoderPDFSet function returns the number of data segments contained in the barcode and sets up the barcode for retrieval. All fields passed to the encoder set function must be text fields or they must be converted to text.
  3. The IDAutomationPDF417EncoderPDFGet function returns a string for the designated data segment. A correct barcode string is achieved when all data segments are combined.
  4. When the barcode string is combined with our PDF417 font, it will produce a PDF417 barcode.
How to create a PDF417 Barcode with Crystal Reports:
  1. Choose View - Field Explorer. Select Formula Fields. Right click and select New. Enter the name you want to identify the formula by and choose OK.
  2. The Formula Editor should now appear. We suggest you copy and paste the following code into the Formula Editor dialog box:
    stringVar CompleteBarcodeString:="";
    stringVar DataToEncode:= {Table.Field};
    numberVar i:=0;
    numberVar Segments:= IDAutomationPDF417EncoderPDFSet(DataToEncode,0 ,0 ,0 ,0 ,0 ,0 );
    For i:=0 to Segments Do
    (
    CompleteBarcodeString := CompleteBarcodeString + IDAutomationPDF417EncoderPDFGet(i);
    );
    CompleteBarcodeString
    Then, change Table.Field to relate to your database. Save the formula.
  3. The field where the PDF417 barcode is to be placed on the report, must allow multiple lines, because the UFL draws the barcode line by line. Format the field so that all borders are removed; borders will usually cause scanning problems. Size the field so it is large enough to contain the barcode.
  4. Choose File - Print Preview or the Preview tab. You should see a series of many numbers in the text field, this is normal.
  5. After you change the font of the field to one of the PDF417 fonts (such as IDAutomationPDF417n4) a correct barcode will be created.
  6. We have also included a simple example of creating a PDF417 barcode in Crystal Version 9 in the Font and Encoder package.
Crystal Reports PDF417 UFL Set Function: (Enter zeros for defaults in all integer fields.)
Int DataSegments=DAutomationFontEncoderPDF417Set(DataToEncode As String, EcLevel As Integer, TotalColumns As Integer, TotalRows As Integer, Truncated As Integer, PDFMode As Integer, ApplyTilde As Integer)
There are a number of ways to format the data you are encoding. It is also possible to combine multiple fields and place functions in a single barcode. For example: Refer to your Crystal Reports documentation for additional information on creating reports with formulas.
PDF417 Font / Encoder Specifications
Character Sets GLI0 which encodes ASCII 0 to 255 of the ASCII character set.
Data Compaction Modes Text Compaction with all four sub modes supporting text and numbers.
Byte Compaction mode supporting numbers, text and binary data.
Reed Solomon Error Correction Levels Selectable from 1 to 8
Font Point Size:

Approximate X dimensions for IDAutomationPDF417n3

12 .048 cm .018"
10 .038 cm .015"
8 .032 cm .012"
6 .024 cm .009"
4 .016 cm .006"

 

Font Names Description
IDAutomationPDF417n3 X to Y ratio =3:
This is the standard PDF417 font. It has a X to Y ratio of 1:3 which is recommended by national and international standards. Y dimension = 3X
IDAutomationPDF417n4 X to Y ratio =4:
This is a taller but thinner version of the PDF417 font for use with lower quality readers and special applications. It has an X dimension of .75 times the X dimension of PDF417c. It has a X to Y ratio of 1:4. This taller version also tends to work better with laser barcode scanners that can read PDF417. Increase the font size after switching to this ratio. Y dimension = 4X
IDAutomationPDF417n5 X to Y ratio =5:
This is a taller and thinner version of the PDF417 font designed to be used for FEDEX label specifications and other applications that require an X to Y ratio of 5. The X dimension of this font is .010" or 10 MILS when printed at 11 points. More about FedEx and PDF-417 is located here.
IDAutomationPDF417n2 X to Y ratio =2:
NOTE: Most scanners cannot dependably read this font. This is a shorter version of the PDF417 font for high quality imagers and scanners. It has an X dimension of 1.5 times the X dimension of PDF417c. It has an X to Y ratio of 1:2. You may use this font to reduce the symbol height if you are using high quality scanners in a clean environment. Decrease the font size after switching to this ratio.
 
Font Names Prior to 7/2003: New Font Name
PDF417c2 IDAutomationPDF417n2
PDF417c IDAutomationPDF417n3
PDF417c4 IDAutomationPDF417n4
PDF417c5 IDAutomationPDF417n5
 

 Product Links: [Barcode Fonts | Barcode Components | Barcode Label Software | Barcode Scanners]

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