IDAutomation.com, Inc., Computers Hardware, Software & Services, Tampa, FL Contact IDAutomationView your cart in the IDAutomation Store  
Loading
Home > Barcode Fonts > 2D Barcodes > QR-Code Font > QR-Code Font and Encoder User Manual

QR-Code Font and Encoder User Manual

Implementation Tutorials

Forum Support Download QR-Code Barcode Demo Now Download QR Code Generator Software Immediately After Purchase

QR-Code Implementation Options

In the event the QR font and graphic encoders provided are not supported in the desired application, other implementation options are available:

  • QR-Code may be printed on an unsupported system by using a font encoder to populate a database with the "text string to print" and by accessing the database from the other system with the QR-Code font.
  • The source code for any single encoder will be supplied with the purchase of the Unlimited Developer License and a signed source code license agreement.

Windows Installation Overview

Extract the files provided with the product and run the installation executable. The .exe will install the files needed in the application folder under Program Files with the following components:

  1. QR-Code Generator Application provides an easy method for users to create QR-Code barcodes and print or paste them into other applications.
  2. Universal 2D fonts used to create QR-Code symbols in addition to other 2D barcodes.
  3. Crystal Reports UFL allows barcode generation in Crystal Reports versions 9 and above.
  4. Windows DLLs are used as the font encoder library all Windows applications, and are installed in the Systems folder. The DLLs are registered by the installation program using RegAsm.exe for COM Interop.
  5. VBA Module may be used in VB, Excel or Access to generate QR Codes.
  6. VB 6 Source Code used to create the QR-Code Encoder for Windows is also supplied.
  7. Microsoft Office Examples are provided for Word mail-merge and Access.

If verifying the accuracy of QR-Code barcodes, consider purchasing a QR Code Barcode Image Reader.

Importing the VBA Module into VB, Excel or Access

The VBA module is required when applying the font encoders in VB 6, Microsoft Excel or Access. The IDAutomation_QRCodeVBA.bas module creates QR Codes quickly by using the already installed ActiveX DLL for the font encoder functionality.

Importing the VBA Module

  1. Extract the files provided with the product.
  2. Open VB, Excel or Access.
  3. If Excel or Access is being used, select Tools - Macro - Visual Basic Editor to open the VB editor.
  4. Run the installation executable in the package, then go to Tools - References and select IDAutomation QRCode Barcode, click OK.
  5. Choose File - Import File and select the module to import from the VBA folder of the extracted files.
  6. If Excel or Access is being used, choose File - Close to close the VB editor and then select File - Save.
  7. After the file is imported, the IDAutomation_QR-Code function may be called according to the chart below. The zero digit is the default for all parameters (which are optional) and is used in automatic mode or a false setting. The "1" (one) digit is used for a true setting.
     

    IDAutomation_QRCodeVBA.bas

    EncQR(DataToEncode As String, Optional ProcTilde As Integer = 0, Optional EncMode As Integer = 0, Optional Version As Integer = 0, Optional ErrorCorrectionLevel As Integer = 0) As String Example:
    =EncQR([Test Data.data])
    or
    =EncQR([Test Data.data],1,0,0,2)

Using QR-Code Fonts in Microsoft Access

There are two implementation options for Microsoft Access, both of which are supported in the IDAutomation QR-Code Barcode Font & Encoder Package. When used in reports and forms, the graphic encoder option may be the easiest option to use.

Graphic Encoder Implementation

  1. Run the installation executable in the package and follow the instructions to complete the installation.
  2. Open a report in Design Mode.
  3. Select Insert - ActiveX Control and choose the IDAutomation QR-Code control.
  4. Move and size the control as necessary. To change the properties of the control such as height and symbology type, right-click on the control and choose Properties.
  5. To bind the control to a data source, enter the table and field or formula in the control source field. The proper barcode will show up after the report is saved and executed.
  6. Additional implementation information is provided in the ActiveX Control Manual.

Font Encoder Implementation

  1. Run the installation executable file in the package and follow the instructions to complete the installation.
  2. Import the VBA module into the database.
  3. Open a report in Design Mode.
  4. Add a text field to the report and size it large enough to contain the entire symbol. Change the font point size of the field to 8 points.
  5. Right-click on the text field and enter the function call as a formula in the control source property. For example:
    =EncQR([Test Data.data])
  6. Save the report and run it; several letters should appear in the text field. This is the data that will create a correct barcode when combined with the 2D font.
  7. Open the report in design mode and select the IDAutomation2D font for the text field. The recommended point size is 8 points.
  8. Save the report and run it; a correct symbol should appear in the text field.

QR Code Generation in Word Mail-Merge

QR-Code barcodes may be created in a Word mail-merge if Excel is used as the data source with the following process:

  1. Extract the files provided with the product.
  2. Run the installation executable in the package to install the IDAutomation2D font.
  3. Import the VBA module into the Excel spreadsheet that will be used as the data source.
  4. Place a title in each column of the spreadsheet on row 1 that will contain the data, and then import the data into the Excel spreadsheet.
  5. Select a blank column on row 1, to the right of the last populated column in the spreadsheet, and title it Barcode.
  6. Add a formula on row 2 of the Barcode column that calls the function as a formula.
    For example, the following formula adds columns A and B to the barcode:
    =EncQR(A2&B2)
    The following formula adds columns A, B and C to the barcode and separates them with a comma delimiter:
    =EncQR(A2&","&B2&","&C2)
  7. Highlight the cell with the formula in it and choose Edit - Copy.
  8. Select the entire range of cells to paste this formula into the Barcode column and choose Edit - Paste.
  9. Follow the procedures in Word to add this spreadsheet as the data source the mail merge.
  10. Add the mail merge field of Barcode to place the barcode in the document.
  11. Highlight the "Barcode" merge field and select the IDAutomation2D font.
  12. After the mail-merge is performed, the barcodes should appear in the merged documents.
  13. A working example is provided in the Word Mail-Merge.doc file included with the install package.

Adobe InDesign QR-Code Integration

There is no direct method of generating QR-Codes in Adobe InDesign. However, Excel may be utilized to encode the data and then that data may be imported into InDesign where the appropriate font is applied to generate an accurate QR Code barcode.

As an alternative, Meadows Printing Solutions provides a 2D InDesign Barcode Generator that installs directly into the application to generate QR-Code, Data Matrix and PDF417 barcode types. A free InDesign QR-Code Generator is also available for QR-Code generation and testing.

Crystal Reports QR Code Integration

Limitations with Crystal Reports Prior to Version 9

The Crystal Reports UFL is designed to work with Crystal Reports 6.0 and above. Yet, because of a Crystal Reports limitation prior to Version 9, only limited information (up to approximately 30 to 40 characters) may be encoded. To overcome this limitation, version 9 or greater is required.

Crystal Reports version 9 and later versions are able to overcome the 254-character limitation by using a formula that is able to retrieve the data encoded in 254 byte chunks. A simple example of creating a QR-Code barcode in Crystal is included in the Font and Encoder package. Please refer to that example, if problems are encountered.

How the QR Code Font and Encoder Works with Crystal Reports

  1. After installing the QR-Code Font and Encoder, the encoder functions will be available in Crystal Reports.
  2. The IDAutomationQRCodeEncoderQRSet 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 IDAutomationQRCodeEncoderQRGet function returns a string for the designated data segment. A correct barcode string is achieved when all data segments are merged.
  4. When the resulting string is combined with IDAutomation's 2D font, it will produce a QR-Code barcode.

How to Create a QR-Code Barcode in Crystal Reports

  1. Choose View - Field Explorer. Select Formula Fields. Right click and select New. Enter a name to identify the formula created and choose OK.
  2. The Formula Editor should now appear.
    • Copy and paste the code below into the Formula Editor dialog box. The Crystal Reports Example.rpt file is provided in this package as an example, and may be referred to for troubleshooting purposes:
      stringVar DataToEncode:= {Table1.Field1};
      stringVar CompleteBarcodeString:="";
      numberVar i:=0;
      numberVar Segments:= IDAutomationQRCodeEncoderQRSet(DataToEncode,0 ,0 ,0 ,0 );
      For i:=0 to Segments Do
      (
      CompleteBarcodeString := CompleteBarcodeString + IDAutomationQRCodeEncoderQRGet(i);
      );
      CompleteBarcodeString
  3. Change the DataToEncode = section of the formula so it encodes fields from a database and save the formula.
  4. The field where the barcode is to be placed on the report must allow multiple lines, because the formula draws the symbol line-by-line. Format the field so that all borders are removed; borders will usually cause scanning problems. Size the field so that it is large enough to contain the barcode.
  5. Choose File - Print Preview or the Preview tab. A series of many characters will be visible in the text field, which is normal.
  6. After the font of the field is changed to the QR-Code Font (IDAutomation2D) an accurate QR Code will be created.

QR Code Encoder Parameters

Number of Segments = IDAutomationQRCodeEncoderQRSet (DataToEncode As String, ProcTilde As Integer = 0, EncMode As Integer = 0, Version As Integer = 0, ErrorCorrectionLevel As Integer = 0)

There are a number of ways to encode data in QR-Codes with Crystal, such as combining multiple fields in a single symbol. A common method is to enable ProcessTilde and use ~d009 for tab and ~d013 for a return. For example:

  • The following formula combines two fields in a single barcode and places a tab function between them:
    stringVar DataToEncode:= {Table1.DataField1} & "~d009" & {Table1.DataField2};
  • The formula below combines two fields with the date function:
    stringVar DataToEncode:= {Table1.DataField1} & "~d009" & {Table1.DataField2} & "~d013" & CurrentDate;

FileMaker Plug-in

IDAutomation's QRCode Barcode may be easily integrated into FileMaker using dynamic calculated fields without the use of scripts with this FileMaker Plugin. The QR-Code is a popular marketing tool to create VCards and meCards to include on business cards and other marketing material.

QR-Code meCard Example

View step-by-step instructions on installing, registering and using the plugin in FileMaker.

Microsoft .NET QR Code Integration

Implementation of QR-Code in .NET applications may be accomplished with graphic or font encoders. Integration into ASP.NET and other web applications is best implemented as a graphic encoder with the ASP.NET Server Control provided in the Advantage Package. Information about printing from the .NET Forms Control without using the font is provided in the .NET Forms Control Manual.

.NET QR Code Font Encoder Example

  1. The following example uses the font encoder to create the text string that will generate an accurate QR Code barcode when printed with the Universal 2D barcode font:
  2. In a .NET project, add a reference to the DLL and place the import statement in the declarations section of the project:
    Imports IDAutomation.Windows.Forms.QRCodeBarcode
  3. Acquire the special text string that will generate a readable QR Code when combined with the IDAutomation2D font:
    Dim NewBarcode As New QRCodeBarcode
    TextBox2.Text = NewBarcode.FontEncode(TextBox1.Text, True, QRCodeBarcode.EncodingModes.Byte, 
    QRCodeBarcode.Versions.AUTO, QRCodeBarcode.ErrorCorrectionLevels.M)

C# Example:

  1. In a .NET project, add a reference to the DLL and place the using statement in the declarations section of the project. For example:
    using IDAutomation.Windows.Forms.QRCodeBarcode;
  2. Obtain the string of data, that when printed with the IDAutomation2D Font, will create a correct symbol:
    QRCodeBarcode NewBarcode = new QRCodeBarcode();
    textBox1.Text = NewBarcode.FontEncode(textBox1.Text, false, EncodingModes.Alphanumeric, Versions.AUTO, ErrorCorrectionLevels.H);
    

Using the Windows DLL QR Code Font Encoder

Install the Font and Encoder for Windows by running the .exe file provided in the package to install TrueType fonts, implementation examples and register the COM DLL. After the DLL is installed and registered, it may be accessed by any application that can retrieve a text string or graphic object from a COM DLL.

The FontEncode function is used to convert the data to encode into a string that will generate a QR barcode when combined with the 2D font. The following is Visual Basic 6 code that places the result in the "PrintableBarcodeString" variable:

 'Initialize COM DLL
Dim QRFontEncoder As QRCodeFontEncoder
Set QRFontEncoder = New QRCodeFontEncoder
QRFontEncoder.FontEncode
DataToEncode,
ProcTilde,
EncodingMode, 
Version,
ErrorCorrectionLevel, Result
PrintableBarcodeString = Result

A Visual Basic project example is included with the package. These files are placed in the destination directory upon installation. Parameter definitions: DataToEncode, ProcTilde, EncodingMode, Version, ErrorCorrectionLevel

Generating QR Codes with Java Class Integration

The Java class file was compiled with the Sun JDK 1.3 and is compatible with Windows, Mac, UNIX, Linux and any other systems supporting Java. Copy the IDAutomation_JavaFontEncoder_QRCode.jar file from the "Java Class Encoder" folder to the system's classpath. Consult the Java documentation or the company that provides the Java virtual machine for assistance.

Integrate the FontEncode Method

After the directories are copied to the classpath 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 com.idautomation.fontencoder.qrcode.*;
class QRCodeBarcodeExample
{
  public static void main ( String [] args )
  {
     String dataToEncode = "QRCode Test";
     QRCodeEncoder qre=new QRCodeEncoder();
     String DataToEncode = "IDAutmation Inc.";
     boolean ApplyTilde = false;
     int EncodingMode = 0;
     int Version = 0;
     int ErrorCorrectionLevel = 0;
     System.out.println( qre.FontEncode(DataToEncode, ApplyTilde, EncodingMode, Version, ErrorCorrectionLevel) );
  }
}

The data string returned by the fontEncode method will create a proper QR Code when printed with the 2D font. To install the font on an operating system, consult the OS documentation or follow IDAutomation's font installation procedures. Property Definitions: DataToEncode, ApplyTilde, EncodingMode, Version, ErrorCorrectionLevel

C++ .H Header File for QR

The C++ header file may be provided upon request with the purchase of an Unlimited Developer License and a signed Source Code Agreement. The header file is unobfuscated C++ source code that makes use of character vectors. It was compiled and tested with Visual Studio 2005 and does not contain any OS-specific code. The QRCodeFontEncoder class may be used to return an encoded string that the IDAutomation 2D font can be applied to, in order to create QR-Code barcodes. This class also contains several properties and enumerations that adjust the resulting symbol size and encoding method. Following is a C++ Implementation example:

#include <string>
#include <iostream>
#include <math.h>
#include <fstream>
#include "IDAutomationQRCode.h"
int main ()
{
     QRCodeFontEncoder QR;
     QR.ApplyTilde = true;
     QR.ErrorCorrectionLevel = QR.ECL_M;
     QR.EncodingMode = QR.Enc_Byte;
     QR.Version = QR.V_07;
     QR.DataToEncode = "IDAutomation.com";
     printf(QR.FontEncode().c_str());
}

XML/BI Publisher Integration

While IDAutomation does not support integration with BI Publisher, one of the Oracle Developers, Tim Dexter, has written a blog on integrating IDAutomation QR-Code Barcodes with XML Publisher.

QR Code Font and Encoder Specifications

The IDAutomation2D Font is used in this package to create QR-Code symbols and is included in several formats including TrueType, PostScript, OpenType and PCL. The IDAutomation2D font should be printed at 8 points unless it is necessary to create a larger or smaller symbol. The IDAutomation2D Font is a "universal" 2D font that may be used with encoders for Data Matrix, PDF417 and QR Code.

Font Point Size

Approximate X Dimensions for QR-Code Font

14 .122 CM 48 MILS
12 .105 CM 41 MILS
10 .086 CM 33 MILS
8 .061 CM 24 MILS
6 .052 CM 20 MILS
4 .031 CM 13 MILS
3 .026 CM 10 MILS
2 .017 CM 6 MILS

Available Tilde Options when ProcessTilde is equal to 1

  • ~dNNN: Represents the ASCII character encoded by the 3 digits NNN. For example, ~d009 represents a tab, ~d013 represents a return and ~d065 represents the character 'A'.

Symbol Version

The symbol version is the size of the symbol from (1) 21x21 to (20) 177x177. Zero is the automatic selection and the default. If the symbol needs to be larger than the selection, the component automatically overrides this value.

QR Font and Encoder Packages Support

If verifying generated QR Code barcodes, consider purchasing a quality QR Code Barcode Scanner.

Back to Top

 © Copyright 2014 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
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.