dlsoft 2d-barcode fontsdownloads.dlsoft.com/manuals/2d_barcode_fonts.pdf4 2d-barcode fonts dlsoft...
TRANSCRIPT
dLSoft
2D-Barcode Fonts
By dLSoft
This manual was produced using ComponentOne Doc-To-Help.™
dLSoft 2D-Barcode Fonts Contents iii
Contents
2D-Barcode Fonts 1
Introduction ............................................................................................................................... 1 Installing additional fonts ............................................................................................ 2
Aztec barcodes ........................................................................................................................... 2 Security and Layers ..................................................................................................... 3 The Aztec font ............................................................................................................. 3 The AZTDF DLL ........................................................................................................ 4 The Aztec control ........................................................................................................ 6 Aztec .NET Managed Component ............................................................................... 8
DataMatrix barcodes ................................................................................................................ 10 PostMatrix ................................................................................................................. 11 DataMatrix font ......................................................................................................... 11 The DMATDF DLL .................................................................................................. 11 The Datamatrix control .............................................................................................. 15 Datamatrix .NET Managed Component .................................................................... 17
GS1 Databar barcodes ............................................................................................................. 21 The Databar Fonts ..................................................................................................... 21 The DBARDF DLL ................................................................................................... 22 The Databar control ................................................................................................... 24 Databar .NET Managed Component ......................................................................... 26
QR Code barcodes ................................................................................................................... 28 Micro QR Code ......................................................................................................... 28 The QR Code Fonts ................................................................................................... 28 The DQRDF DLL ..................................................................................................... 29 The QR control .......................................................................................................... 32 QR Code .NET Managed Component ....................................................................... 34
PDF417 barcodes ..................................................................................................................... 36 Encoding Modes ........................................................................................................ 36 Security level ............................................................................................................. 37 Aspect ratio................................................................................................................ 37 Micro PDF 417 .......................................................................................................... 37 The PDF font ............................................................................................................. 38 The PDFDF DLL ....................................................................................................... 38 The PDF417 control .................................................................................................. 42 PDF417 .NET Managed Component ......................................................................... 43
Common DLL features ............................................................................................................ 46 ErrorMessXX() .......................................................................................................... 46 EnumModeXX() ........................................................................................................ 46 MaxLevelXX() .......................................................................................................... 46
Common .NET component features ........................................................................................ 47 Using .NET Components in Visual Studio ................................................................ 47
Adding a .NET Component to the ToolBox ............................................................................ 47 Adding a .NET component to a project. .................................................................................. 47 Setting and retrieving property values programmatically ........................................................ 48 Setting properties through the Barcode properties dialog box ................................................. 48 Displaying a barcode on a form ............................................................................................... 49
iv Contents dLSoft 2D-Barcode Fonts
Printing a barcode .................................................................................................................... 49 Licensing the component ......................................................................................................... 49
.NET Information properties ..................................................................................... 50
.NET Component Methods ........................................................................................ 51 .NET Standard components ..................................................................................................... 51 Common Control Features ....................................................................................................... 51
Common control methods ......................................................................................... 52 Using with CreateObject .......................................................................................................... 53 Error Codes .............................................................................................................................. 54 Font table ................................................................................................................................. 54
Index 57
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 1
2D-Barcode Fonts
Introduction Barcode fonts enable you to print barcodes on high quality graphics printers that can accept fonts (i.e. a Windows
supported graphics printer or a PostScript printer that can accept downloaded fonts). However, the user needs to be
aware of a number of factors that determine whether printed barcodes can actually be scanned correctly.
1. Just because you are using a barcode font, this does NOT mean that you can type ABC, render it is the barcode font,
and produce a scannable barcode image. Barcodes – especially 2D barcodes like PDF417 – include other "characters" in
addition to those which you enter as data. In the case of PDF417 each row of the barcode starts with a start pattern and
ends with a stop pattern. Many of the characters in the barcode are actually "error correction digits" designed to enable
the barcode to be decoded correctly even if some parts of the image have been damaged.
2. The thickness of bars and spaces in barcodes is important. Some types of barcode use only two thicknesses of bar,
others use three thicknesses, and others more. Even when you print a barcode using a dLSoft barcode font, you need to
ensure that the barcode has not been printed too small - so that within the resolution of the printer a single thickness bar
has been printed at the same size as a double thickness bar. Consequently it is essential that you check that a printed
barcode is readable using an appropriate scanner or reader.
Barcodes printed by laser or quality ink-jet printer will, in general, be printed correctly, but codes printed by matrix
printers must be reproduced at a large enough scale that the barcodes unit size is at least as large as the printer's pins.
3. Bar thickness reduction: Most dLSoft barcode fonts (apart from the GS1 Databar font) are supplied in three bar
thicknesses. The Wide font (and its variants - names ending in W) should be suitable for most 600 and 1200 dpi laser
printers - it has the bar/space ratio defined at its correct value. The Regular font (names ending in R) has all bars reduced
by 5-8% and will probably be a better choice for 300 dpi laser printers and good quality ink-jets. The Narrow font
(names ending in N) has all bars reduced by 10-16% and is supplied for users who will be creating master copy which
will subsequently be printed using a wet ink technique (in which the ink spreads, so making each bar thicker than in the
master). The narrow fonts should only be used if you know that a bar thickness reduction is required. Picking the wrong
font usually produces unreadable images! If greater control of bar thickness is needed then an image creating system,
such as dBarcode, will be required.
The font details and translation DLL calling instructions given in the following sections cover the following font kits:
Aztec Font Kit
DataMatrix Font Kit
GS1 Databar Font Kit
PDF417 Font Kit
QR Code Font Kit
Please see the relevant section for details of your kit. Note that the 64 bit DLLs have names ending in 64, but are
otherwise used in the same was as their 32 bit counterparts.
2 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Installing additional fonts
While most of the commonly used fonts are installed automatically, you may wish to install additional fonts, including
reduced or narrow fonts, or Postcript variants.
Note that some additional fonts are supplied in compressed folders. Please copy the contents of a compressed folder to a
normal temporary folder before attempting to install the fonts. The compressed fonts folder will be located under your
chosen samples folder. [The additional fonts in the Databar Font Kit are not compressed]
Windows XP/2003/Vista
Open the Font Applet in the Windows Control Panel
From the Fonts window menu bar choose "Install New Font".
The Add fonts dialog appears.
Use the Drives and directory list boxes to select the installation directory containing your fonts. (If you are transferring
the fonts to another computer obviously copy them from the original installation directory to some medium that can be
accessed by the the new machine.)
Ensure that the "Copy Fonts to Fonts folder" check box is checked.
Select the fonts you wish to install from the list presented, and then push the OK button.
Your fonts are now ready for use.
Windows 7
For TrueType/OpenType fonts:
Open the Control Panel Choose Appearance and Personalisation.
Click on Fonts to open the Fonts windows
Now drag the fonts you require to the Fonts Windows
For PostScript fonts double-click on the .PFM file. The font viewer opens. Click on the Install button at the top of the
viewer.
Windows 8/10
Open File Explorer (Windows Key + X, select File Explorer from pop-up menu).
Click on Fonts to open the Fonts windows
Now drag the fonts you require to the Fonts Windows
For PostScript fonts double-click on the .PFM file. The font viewer opens. Click on the Install button at the top of the
viewer.
Your fonts are now ready for use, and the temporary folder may be deleted.
Aztec barcodes Aztec is a matrix symbology that supports the entire ASCII character set and offers several error checking modes. Aztec
symbols are square and may be read at any orientation.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 3
The symbol is made up of squares which "grow" from the centre around a centre mark. The size of the symbol is
characterised by the number of "layers" outside the centre mark, and this can range from 1 – 32.
Security and Layers
In Normal mode the user may select any percentage of the symbol to contain error checking data within the range 1 –
99%. This is the Level parameter in calls to the AZTDF.DLL functions. If a value of 0 is used then the symbol will
actually be produced with the default amount of error correction (which is 23% + 3 codewords). The higher the security
level the greater will be the number of layers required to contain the symbol – and hence its overall size.
In Compact mode the user specifies the number of layers used to contain the symbols information – and this is restricted
to the range 1 – 4. The DLL will insert error correction data in the space available.
In Full range mode again the user specifies the number of layers allowed for the symbol, but this time the range is 1 – 32.
Again error correction data is used to fill otherwise unused space in the specified number of layers.
In Full range mode the maximum capacity of Aztec Code symbols is approximately as follows:
Digits only – maximum capacity 3800 digits
Alphanumeric text – maximum capacity 3000 characters*
Byte values – maximum capacity 1900 bytes
(*Note that capital letters, punctuation and new lines/paragraphs reduce this value.)
Runes are special Aztec symbols that consist of a single layer and have no security options.
Appended symbols are not supported at this time.
The Aztec font
The Aztec font system includes TrueType and PostScript fonts for creating Aztec barcodes by printing characters to
generate bars and spaces. Aztec barcodes are made up of bars and spaces that may be 1 or more units wide. The dLSoft
Aztec fonts uses the ASCII characters 0 (zero) - z to represent 64 combinations of 6 bars and spaces as shown in the font
table at the end of this document, where a 1 is a bar and a 0 is a space. The individual characters are made up of six
square in a pattern 3 high by 2 wide, with each square representing a bit of a 6 bit binary value.
The dLSoft Aztec fonts are provided in different weights, to allow for ink spread during wet ink printing and the line
broadening found in several printers designed for use with personal computers.
Font name weight
AZTW full size
AZTR 5% width and height reduction
AZTN 10% width and height reduction
Users should determine which font weight is suitable for their printer by testing each font weight. It should be noted that
if gaps between the font squares are clearly visible then the barcode will not scan correctly.
4 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
The AZTDF DLL
To convert a string of characters into the bars and spaces required for the barcode requires converting the character string
into another string – made up of only the 0 - z characters present in the Aztec font.
The following DLLs will perform the conversion:
AZTDF.DLL – 32 bit ANSI version
AZTDFU.DLL – 32 bit Unicode version
AZTDF64.DLL – 64 bit ANSI version
AZTDF64U.DLL – 64 bit Unicode version
The DLLs provide three function calls which can either return the required string, copy it to the clipboard, or save it to a
named disk file. These functions may be called from Visual Basic (including Visual Basic for Applications in Microsoft
Office), Visual C++, Visual Foxpro, Delphi, C++ Builder, and in fact virtually every language that can make DLL calls.
The functions are called with parameters that specify the options available for the barcode:
szIn – is a pointer to a string containing the bytes used as data to create the barcode. While passed as a text string, the
string can contain non-text bytes (including ASCII 0) provided that the length parameter (n) is used to specify the length
of the data. If n is 0, then the string is assumed to be a null-terminated string.
n – a pointer to an integer which is either 0 or specified the length of the data in szIn.
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0.
level – a pointer to an integer specifying the security level of the barcode generated. Allowed values for Aztec codes
depend on the mode, and are 0-99 for Normal mode, 1-4 for Compact mode, and 1-32 for Full range mode (the value is
ignored for Runes). Note that for Compact and Full range the security level is actually the required number of Aztec
layers in the symbol.
mode – a pointer to an integer specifying the type of Aztec barcode created. The allowed values are shown below.
mode parameter Barcode type
0 Normal
1 Compact
2 Full range
3 Rune
For most applications a mode of 0 is recommended, along with a level of 0 which provides the default value of 23% + 3
codewords.
Aztdf Function calls
The available function calls are:
BarsOutAz()
Creates the barcode in the device context hdc at coordinates xin,yin (in MM_TEXT units) using the properties specified.
Declared for C as
int WINAPI BarsOutAz(HDC hdc,int x, int y, LPTSTR szIn, int flags, int level, int mode, int fontsize,LPTSTR
fontname);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
flags must be 0 in the present release,
mode is an integer that specifies the mode for the barcode,
level is an integer that specifies the security level for the symbol, and
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 5
fontname is a pointer to a string which specifies the name, and fontsize is an integer that specifies the height (in Pixels)
of the font that will be used to render the barcode.
Bar2Dazf ()
- creates text for Aztec font and returns text in szOut
Declared for C as
int WINAPI Bar2Dazf(LPSTR szIn,LPINT n, LPINT flags, LPINT level, LPINT mode, LPSTR szOut);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
flags must be 0 in the present release,
mode is the mode for the barcode type (normally 0), and
szOut is a pointer to a string which will receive the characters to be rendered in the AZ font.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dazf Lib "aztdf" (ByVal szIn As String, ByRef n As Long, ByRef fl As Long, ByRef lv
As Long, ByRef mo As Long, ByRef szOut As String) As Long
Bar2Dazc ()
- creates text for Aztec font and copies text to the Windows clipboard
Declared for C as
int WINAPI Bar2Dazc(LPSTR szIn,LPINT n, LPINT flags, LPINT level, LPINT mode);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
flags must be 0 in the present release,
mode is the mode for the barcode type (normally 0).
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dazc Lib "aztdf" (ByVal szIn As String, ByRef n As Long, ByRef fl As Long, ByRef lv
As Long, ByRef mo As Long) As Long
Bar2Dazw ()
- creates text for Aztec font and writes text to file szFilename
Declared for C as
int WINAPI Bar2Dazw(LPSTR szIn,LPINT n, LPINT flags, LPINT level, LPINT mode, LPSTR szFilename);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
flags must be 0 in the present release,
mode is the mode for the barcode type (normally 0), and
szFilename is a pointer to a string that contains the full pathname of the file to receive the text. If the file exists it will be
overwritten. If it does not exist it will be created if possible.
The call returns the number of bytes written to file, which is 0 in the event of a barcode creation error, or -1 in the event
of a file creation error.
6 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dazw Lib "aztdf" (ByVal szIn As String, ByRef n As Long, ByRef fl As Long, ByRef lv
As Long, ByRef mo As Long, ByRef szFilename As String) As Long
Bar2Dazd ()
- decodes text strings previously encoded using Bar2Dazf(),Bar2Dazc(), or Bar2Dazw().
Declared for C as
int WINAPI Bar2Dazd(LPSTR szIn, LPSTR szOut);
where szIn is a pointer to a string containing the barcode which is to be decoded;
szOut is a pointer to a string that will receive the decoded output.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dazd Lib "aztdf" (ByVal szIn As String, ByRef szOut As String) As Long
The Aztec control
The AZTOCX control is an Active-X control which simplifies the use of barcodes in Active-X containers such as Visual
Basic and MS Access.
The AZTOCX control may be placed on a form in most applications which support Active-X controls, such as Visual
Basic, Microsoft Access, etc. The Aztec barcode properties may be specified through a series of Properties, either via
programming, or by setting the properties in the control’s property pages.
Placing the Aztec control on a form
Visual Basic 6
To add the control to a Visual Basic project select Components from the Project menu, then select AZTOCX Active-X
Control module from the list of controls displayed and push the OK button. The module’s icon will appear in the
Toolbox. The control may then be added to a form by clicking on the control’s icon and then drawing a rectangle for the
control on the required form.
If the control is to be visible then the area allowed should be large enough to hold the largest barcode required. If the
control is to be hidden, then the size is irrelevant.
Once added to a form, selection of the control will show the available properties in Visual Basic’s properties window.
VB.NET and C#
The control may be added to the Visual Studio Toolbox by right clicking on the Toolbox and selecting Add/Remove
Items (or Choose Items for VS 2005 or later) from the pop-up menu displayed, then checking the control in the list
presented. The control will then appear as an icon on the Toolbox.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 7
Access
To add the control to an Access Form or Report, open the form or report in Design view and ensure that the Toolbox is
visible (its on the View menu). Select the “More controls” icon on the Toolbox and then select the AZTOCX Active-X
Control module from the list of controls displayed. Draw a rectangle for the control on the from or report.
Once added to a form or report, selection of the control will show the available properties in Access’s properties
window. The font should be set by right-clicking on the control and choosing the Aztocx control properties from the
displayed menu.
Aztec Property pages
The control also has its own property pages which may be accessed by right-clicking on the control and selecting
Properties from the displayed menu.
General Property page
This permits the setting of the barcode’s mode and security level properties, and allows the control to be set to resize
itself each time it is drawn
Data Property page
The edit box on this page shows the data currently being used to generate the barcode image. It is useful only for
displayable characters. To provide data which includes non-printable characters the Caption property should be set via
programming.
Font Property page
This page allows the user to select the barcode font and font size used to generate the barcode.
Colors Property page
This page allows the user to specify the foreground (the bars) and background color of the barcode generated. In general
barcodes should be produced with a black foreground and a white background color.
Aztec Control Properties
The control has the following properties which may be set in the property pages or programmatically with Visual Basic.
Caption: (BSTR) the data which will be converted into a barcode
AutoSize: (Boolean) if non-zero causes the control to resize itself to contain the barcode.
BackColor: (Colorref) the background color
CapLength: (integer) normally 0, in which case the length of the data string in the Caption property is determined
automatically. If non-zero it is taken to be the number of characters in the Caption property to be used as data.
Errorcode: (integer) a non-zero value is returned if the data supplied in the Caption property can be converted into a
valid barcode.
Flags: (integer) if bit 7 is set (ie 128) the data is encoded as Unicode, otherwise as ANSI.
Font: (Font) the font in which the Output characters will be displayed
ForeColor: (Colorref) the color of the bars in the barcode
Level: (integer) the security level for the generated barcode (see the DLL above for a description)
8 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Mode: (integer) the mode used to generate the barcode (see the DLL above for a description)
Output: (CString) the characters which when displayed in the correct font, produce the barcode. Note that this string
may be much larger than the Caption string.
In addition the control supports the normal Active-X properties, such as Visible, Height, Width, etc.
Aztec .NET Managed Component
Developer versions require the developer’s serial number to be passed to the component using the Serial property before
the Barcode() method is called. The Serial property should be set to the serial number provided for your product, e.g.
Aztnet1.Serial="12345" for VB
aztnet1.Serial="12345"; for C#
Use of an incorrect serial number will result in randomly scrambled symbols.
Main properties and methods are shown below; others are listed in the Common .NET component features section
Aztec.NET Properties
AzFlag
Type: bool
Default: false
Sets the Aztec flag on or off.
AzMenu
Type: bool
Default: false
Sets the Menu flag on or off.
AzRvideo
Type: bool
Default: false
Sets the Reverse Video flag on or off.
ByteNumber
Type: integer
Default: 0
Allowed values: 0 – barcode byte capacity
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 9
When ByteValue is greater than 0 the Caption string (which is a Unicode string) is unpacked into 8-bit ASCII characters
before the data is used to generate the barcode.
Caption
Type: string
Default: "0123456789"
Allowed values: Any text string.
Note: only text strings recognised as valid barcodes will result in a barcode picture. An Illegal character in the text string
will cause an Error value to be set.
CodeType
Type: bCode enumeration member
Default: bCode.AZT
Allowed values: bCode.AZT
CodeTypeValue
Type: integer
Default: 0
Allowed values: 0
The barcode type can be set using either the CodeType property or the CodeTypeValue property.
Flag
Type: Boolean
Default: false
Allowed values: true or false
When Flag is set to true the Caption data is treated as a Unicode string and converted to a byte stream. When Flag is
false the Caption data is handled as described for the ByteNumber property.
StartMode
Type: integer
Default: 0
Allowed values: See 2D Barcodes section for allowed mode setting for specific barcode types.
SecurityLevel
Type: integer
Default: 0
Allowed values: See 2D Barcodes section for allowed security level setting for specific barcode types and modes.
10 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Aztec.NET Methods
Barcode()
Return Type: string
This method causes a barcode to be created as a sequence of character that, when displayed in the AZTx font will form
the barcode symbol.
Note that the barcode symbol is determined only when this method is called, so the information properties are not set
until this method has been called.
BarDecode(string bc)
Return Type: string
This method returns a string decoded from the barcode passed as parameter bc. Note that bc is a barcode created by the
Barcode() method.
DataMatrix barcodes DataMatrix is a two-dimensional matrix symbology that is made up of square modules arranged within a finder pattern.
DataMatrix symbols may be square or rectangular.
DataMatrix symbols may include a user-select amount of error-correction, set by the security parameter. For Square
symbols the value may range from 0 – 24. For Rectangular symbols the value may range from 0 - 6.
DataMatrix symbols can encode the entire ASCII character set and uses multiple encoding modes, which are, in order of
efficiency:
Double digits – maximum capacity 3100 digits
Alphanumeric text – maximum capacity 2300 characters*
Byte values – maximum capacity 1550 bytes
*Note that capital letters, punctuation and new lines/paragraphs reduce this value.
dLSoft 2D barcode products support only ECC200 symbols – the older ECC140 and below are not supported. Also at
this time ECI and Appended symbols are not supported.
The size of a Datamatrix barcode is normally determined by its content and security level, although a size may be
specified by setting the number of columns in the symbol; the only other control allowed is whether the barcode is
square or rectangular.
The DeutschePost variant of Datamatrix may be created generally by checking the DeutschePost option in dialogs, or
setting the DL_DEUTSCHEPOST flag (bit 9, or value 512) in the flags parameter of the function calls.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 11
PostMatrix
The Deutsche Post PostMatrix code is a Datamatrix symbol preceeded by two vertical lines before the vertical alignment
edge of the Datamatrix symbol.
PostMatrix
PostMatrix codes mat be produced by checking the Deutsche Post bars option in the Active-X properties dialog, or
setting the DL_POSTMATRIX flag (bit 6, or value 64) in the flags parameter of the function calls.
DataMatrix font
The DataMatrix font system includes TrueType and PostScript fonts for creating DataMatrix barcodes by printing
characters to generate bars and spaces. DataMatrix barcodes are made up of bars and spaces that may be 1 or more units
wide. The dLSoft DataMatrix fonts uses the ASCII characters 0 (zero) - z to represent 64 combinations of 6 bars and
spaces as shown in the font table at the end of this document, where a 1 is a bar and a 0 is a space. The individual
characters are made up of six square in a pattern 3 high by 2 wide, with each square representing a bit of a 6 bit binary
value.
The dLSoft DataMatrix fonts are provided in different weights, to allow for ink spread during wet ink printing and the
line broadening found in several printers designed for use with personal computers.
Font name weight
AZTW full size
AZTR 5% width reduction
AZTN 10% width reduction
(DataMatrix fonts are the same as the Aztec fonts)
Users should determine which font weight is suitable for their printer by testing each font weight. It should be noted that
if gaps between the font squares are clearly visible then the barcode will not scan correctly.
The DMATDF DLL
To convert a string of characters into the bars and spaces required for the barcode requires converting the character string
into another string – made up of only the 0 - z characters present in the Datamatrix font.
The following DLLs will perform the conversion:
12 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
DMATDF.DLL – 32 bit ANSI version
DMATDFU.DLL – 32 bit Unicode version
DMATDF 64.DLL – 64 bit ANSI version
DMATDF 64U.DLL – 64 bit Unicode version
The DLLs provide three function calls which can either return the required string, copy it to the clipboard, or save it to a
named disk file. These functions may be called from Visual Basic (including Visual Basic for Applications in Microsoft
Office), Visual C++, Visual Foxpro, Delphi, C++ Builder, and in fact virtually every language that can make DLL calls.
The functions are called with parameters that specify the options available for the barcode:
szIn – is a pointer to a string containing the bytes used as data to create the barcode. While passed as a text string, the
string can contain non-text bytes (including ASCII 0) provided that the length parameter (n) is used to specify the length
of the data. If n is 0, then the string is assumed to be a null-terminated string.
n – a pointer to an integer which is either 0 or specified the length of the data in szIn.
code - specifies the barcode type.
Type code value
DataMatrix 0
DMRE_8x48 1
DMRE_8x64 2
DMRE_12x64 3
DMRE_16x64 4
DMRE_24x32 5
DMRE_24x36 6
DMRE_24x48 7
DMRE_24x64 8
DMRE_26x32 9
DMRE_26x40 10
DMRE_26x48 11
DMRE_26x64 12
Note that specific functions use the code parameter to enable DMRE barcodes to be created. Older functions (without a
code parameter) are included for backward compatibility.
flags – an integer with specific bits:
bit 1 (ie. Flags value 2) may be set to 1 to force GS1 encoding (and automatic handling of AIs)
bit 6 (ie 64) when set a PostMatrix symbol is generated. Otherwise this bit should be 0
bit 7. (ie. 128) in the Unicode versions the data may be encoded as Unicode by setting bit 7 to 1.
bit 9 (ie 512) may be set to 1 to create a DeutschePost symbol in Base256 encoding mode
mode specifies the encoding and shape of the barcode:
Mode value mode
0 Automatic – Square
1 Automatic – Rectangular
2 ASCII encoding – Square
3 ASCII encoding – Rectangular
4 C40 encoding – Square
5 C40 encoding – Rectangular
6 Text encoding – Square
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 13
7 Text encoding – Rectangular
8 X12 encoding – Square
9 X12 encoding – Rectangular
10 EDIFACT encoding – Square
11 EDIFACT encoding – Rectangular
12 Base 256 encoding – Square
13 Base 256 encoding – Rectangular
security is the security level and szOut is a pointer to a string which will receive the characters to be rendered in the
DataMatrix (AZT) font.
The security level has allowed values of 0 – 24 for square symbols, or 0 – 6 for rectangular symbols. (A negative security
level may be used to specify the number of columns in the symbol in those calls which do not include a columns
parameter. This feature is included for backward compatability only. New applications should use the calls that do
contain a columns parameter.).
Columns is the number of elements across the symbol. If a value of 0 is used then the symbol is created using the
smallest number of elements possible. The value can be 10 – 144 for square symbols, or 18 – 48 for rectangular symbols.
Dmatdf Function calls
The available function calls are:
BarsOutDm()
Creates the barcode in the device context hdc at coordinates xin,yin (in MM_TEXT units) using the properties specified.
Declared for C as
int WINAPI BarsOutDm(HDC hdc,int x, int y, LPTSTR szIn, int flags, int columns, int mode, int level, int
fontsize,LPTSTR fontname);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
mode is and integer that specifies the mode for the barcode,
columns is an integer that specifies the number of columns in the symbol
level is an integer that specifies the security level of the symbol
flags is an integer that specifies additional characteristics, and
fontname is a pointer to a string which specifies the name, and fontsize is an integer that specifies the height (in Pixels)
of the font that will be used to render the barcode.
Bar2Ddmf ()
- creates text for Datamatrix font and returns the text in szOut
Declared for C as
int WINAPI Bar2Ddmf(LPSTR szIn,LPINT n, LPINT flags, LPINT mode, LPINT security, LPSTR szOut);
int WINAPI Bar2Ddmf2(LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT mode, LPINT security, LPSTR
szOut);
int WINAPI Bar2Ddmfx(LPSTR szIn,LPINT n, LPINT code, LPINT flags, LPINT columns, LPINT mode, LPINT
security, LPSTR szOut);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
code, flags, columns, mode and security: see details under The DMATDF DLL
14 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Ddmf Lib "dmatdf" (ByVal szIn As String, ByRef n As Long, ByRef flg As Long, ByRef
mo As Long, ByRef security As Long, ByRef szOut As String) As Long
Bar2Ddmc ()
- creates text for Datamatrix font and copies to the Windows clipboard
Declared for C as
int WINAPI Bar2Ddmc(LPSTR szIn,LPINT n, LPINT flags, LPINT mode, LPINT security);
int WINAPI Bar2Ddmc2(LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT mode, LPINT security);
int WINAPI Bar2Ddmcx(LPSTR szIn,LPINT n, LPINT code, LPINT flags, LPINT columns, LPINT mode, LPINT
security);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
code, flags, columns, mode and security: see details under The DMATDF DLL
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Ddmc Lib "dmatdf" (ByVal szIn As String, ByRef n As Long, ByRef mo As Long, ByRef
security As Long) As Long
Bar2Ddmw ()
- creates text for Datamatrix font and writes to file szFilename
Declared for C as
int WINAPI Bar2Ddmw(LPSTR szIn,LPINT n, LPINT flags, LPINT mode, LPINT security, LPSTR szFilename);
int WINAPI Bar2Ddmw2(LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT mode, LPINT security, LPSTR
szFilename);
int WINAPI Bar2Ddmwx(LPSTR szIn,LPINT n, LPINT code, LPINT flags, LPINT columns, LPINT mode, LPINT
security, LPSTR szFilename);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
code, flags, columns, mode and security: see details under The DMATDF DLL
The call returns the number of bytes written to file, which is 0 in the event of a barcode creation error, or -1 in the event
of a file creation error.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Ddmw Lib "dmatdf" (ByVal szIn As String, ByRef n As Long, ByRef mo As Long,
ByRef security As Long, ByRef szFilename As String) As Long
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 15
Bar2Ddmd ()
- decodes text strings previously encoded using Bar2Ddmf(),Bar2Ddmc(), or Bar2Ddmw().
Declared for C as
int WINAPI Bar2Ddmd(LPSTR szIn, LPSTR szOut);
where szIn is a pointer to a string containing the barcode which is to be decoded;
szOut is a pointer to a string that will receive the decoded output.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Ddmd Lib "dmatdf" (ByVal szIn As String, ByRef szOut As String) As Long
The Datamatrix control
The DMFOCX control is an Active-X control which simplifies the use of barcodes in Active-X containers such as Visual
Basic and MS Access.
The DMFOCX control may be placed on a form in most applications which support Active-X controls, such as Visual
Basic, Microsoft Access, etc. The Datamatrix barcode properties may be specified through a series of Properties, either
via programming, or by setting the properties in the control’s property pages.
Placing the Datamatrix control on a form
Visual Basic 6
To add the control to a Visual Basic project select Components from the Project menu, then select DMFOCX Active-X
Control module from the list of controls displayed and push the OK button. The module’s icon will appear in the
Toolbox. The control may then be added to a form by clicking on the control’s icon and then drawing a rectangle for the
control on the required form.
If the control is to be visible then the area allowed should be large enough to hold the largest barcode required. If the
control is to be hidden, then the size is irrelevant.
Once added to a form, selection of the control will show the available properties in Visual Basic’s properties window.
VB.NET and C#
The control may be added to the Visual Studio Toolbox by right clicking on the Toolbox and selecting Add/Remove
Items (or Choose Items for VS 2005 or later) from the pop-up menu displayed, then checking the control in the list
presented. The control will then appear as an icon on the Toolbox.
Access
To add the control to an Access Form or Report, open the form or report in Design view and ensure that the Toolbox is
visible (its on the View menu). Select the “More controls” icon on the Toolbox and then select the DMFOCX Active-X
Control module from the list of controls displayed. Draw a rectangle for the control on the from or report.
Once added to a form or report, selection of the control will show the available properties in Access’s properties
window. The font should be set by right-clicking on the control and choosing the Dmfocx control properties from the
displayed menu.
16 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
DataMatrix Property pages
The control also has its own property pages which may be accessed by right-clicking on the control and selecting
Properties from the displayed menu.
General Property page
This permits the setting of the barcode’s mode (Square, Rectangular, Square with GS1 encoding or Rectangular with
GS1 encoding) and security level properties, and allows the control to be set to resize itself each time it is drawn
Data Property page
The edit box on this page shows the data currently being used to generate the barcode image. It is useful only for
displayable characters. To provide data which includes non-printable characters the Caption property should be set via
programming.
Font Property page
This page allows the user to select the barcode font and font size used to generate the barcode.
Colors Property page
This page allows the user to specify the foreground (the bars) and background color of the barcode generated. In general
barcodes should be produced with a black foreground and a white background color.
The DataMatrix Control Properties
The control has the following properties which may be set in the property pages or programmatically with Visual Basic.
Caption: (BSTR) the data which will be converted into a barcode
AutoSize: (Boolean) if non-zero causes the control to resize itself to contain the barcode.
BackColor: (Colorref) the background color
CapLength: (integer) normally 0, in which case the length of the data string in the Caption property is determined
automatically. If non-zero it is taken to be the number of characters in the Caption property to be used as data.
CodeType: (integer) a value which specifies the barcode type:
Barcode Type CodeType
Datamatrix 0
bCode.DMRE_8x48 1
bCode.DMRE_8x64 2
bCode.DMRE_12x64 3
bCode.DMRE_16x64 4
bCode.DMRE_24x32 5
bCode.DMRE_24x36 6
bCode.DMRE_24x48 7
bCode.DMRE_24x64 8
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 17
bCode.DMRE_26x32 9
bCode.DMRE_26x40 10
bCode.DMRE_26x48 11
bCode.DMRE_26x64 12
Errorcode: (integer) a non-zero value is returned if the data supplied in the Caption property can be converted into a
valid barcode.
Flags: (integer) may be used to force GS1 encoding (and automatic handling of AIs) by setting bit 1 to 1 (ie. Flags
value 2); in the Unicode versions the data may be encoded as Unicode by setting bit 7 to 1. (ie. 128); If bit 6 is set to 1
(ie 64) then a PostMatrix symbol is generated; If bit 9 (ie 512) is set to 1 then a DeutschePost symbol is created in
Base256 encoding mode.
Font: (Font) the font in which the Output characters will be displayed
ForeColor: (Colorref) the color of the bars in the barcode
Columns: (integer) the number of columns in the symbol; may be overridden by the security level.
Level: (integer) the security level for the generated barcode (see security under The DMATDF DLL above for a
description) A negative Level may be used to specify the number of columns in the symbol.
Mode: (integer) the mode specifies the encoding and shape of the barcode:
Mode value mode
0 Automatic – Square
1 Automatic – Rectangular
2 ASCII encoding – Square
3 ASCII encoding – Rectangular
4 C40 encoding – Square
5 C40 encoding – Rectangular
6 Text encoding – Square
7 Text encoding – Rectangular
8 X12 encoding – Square
9 X12 encoding – Rectangular
10 EDIFACT encoding – Square
11 EDIFACT encoding – Rectangular
12 Base 256 encoding – Square
13 Base 256 encoding – Rectangular
Output: (CString) the characters which when displayed in the correct font, produce the barcode. Note that this string
may be much larger than the Caption string.
In addition the control supports the normal Active-X properties, such as Visible, Height, Width, etc.
Datamatrix .NET Managed Component
Developer versions require the developer’s serial number to be passed to the component using the Serial property before
the Barcode() method is called. The Serial property should be set to the serial number provided for your product, e.g.
Dmfnet1.Serial="12345" for VB
dmfnet1.Serial="12345"; for C#
Main properties and methods are shown below; others are listed in the Common .NET component features section
18 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Datamatrix.NET Properties
ByteNumber
Type: integer
Default: 0
Allowed values: 0 – barcode byte capacity
When ByteValue is greater than 0 the Caption string (which is a Unicode string) is unpacked into 8-bit ASCII characters
before the data is used to generate the barcode – ie. Only the low-order byte of each character is used.
When ByteNumber is 0 the Caption string is converted to bytes according to the length of each character in the string.
(see also Flag)
Caption
Type: string
Default: "0123456789"
Allowed values: Any text string.
Note: only text strings recognised as valid barcodes will result in a barcode picture. An Illegal character in the text string
will cause an Error value to be set.
CodeType
Type: bCode enumeration member
Default: bCode.DMT
Allowed values: bCode.DMT
CodeType codeTypeValue
bCode.DMT (standard Datamatrix) 0
bCode.DMRE_8x48 1
bCode.DMRE_8x64 2
bCode.DMRE_12x64 3
bCode.DMRE_16x64 4
bCode.DMRE_24x32 5
bCode.DMRE_24x36 6
bCode.DMRE_24x48 7
bCode.DMRE_24x64 8
bCode.DMRE_26x32 9
bCode.DMRE_26x40 10
bCode.DMRE_26x48 11
bCode.DMRE_26x64 12
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 19
CodeTypeValue
Type: integer
Default: 0
Allowed values: see CodeType
The barcode type can be set using either the CodeType property or the CodeTypeValue property
DeutschePost
Type: Boolean
Default: false
Allowed values: true or false
When set to True the sumbol is created in Base256 encoding as required by some DeutschePost applications.
Flag
Type: Boolean
Default: false
Allowed values: true or false
When Flag is set to true the Caption data is treated as a Unicode string and converted to a byte stream. When Flag is
false the Caption data is handled as described for the ByteNumber property.
GS1_Flag
Type: Boolean
Default: false
Allowed values: true or false
When GS1_Flag is set to true the Caption data is encoded using GS1 Datamatrix rules, scanned for valid Application
Identifiers (AIs), and brackets removed.
If GS1_Flag is false the symbol is created using standard Datamatrix rules.
Note that making the first data character FNC1 (ASCII 232) has the same effect as setting the GS1_Flag to true.
PostFlag
Type: bool
Default: false
Allowed values: true or false
When set true the symbol is created as a PostMatrix symbol, with two additional vertical bars.
StartMode
Type: integer
20 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Default: 0
Allowed values:
StartMode value DataMatrix type
0 Auto Square
1 Auto Rectangular
2 ASCII Square
3 ASCII Rectangular
4 C40 Square
5 C40 Rectangular
6 Text Square
7 Text Rectangular
8 X12 Square
9 X12 Rectangular
10 EDIFACT Square
11 EDIFACT Rectangular
12 Base 256 Square
13 Base 256 Rectangular
Note that rectangular symbols have a much smaller capacity than square ones!.
SecurityLevel
Type: integer
Default: 0
Allowed values: See security under The DMATDF DLL section for allowed security level settings. A negative
SecurityLevel may be used to specify the number of columns in the symbol.
Datamatrix.NET Methods
Barcode()
Return Type: string
This method causes a barcode to be created as a sequence of character that, when displayed in the AZTx font will form
the barcode symbol.
Note that the barcode symbol is determined only when this method is called, so the information properties are not set
until this method has been called.
BarDecode(string bc)
Return Type: string
This method returns a string decoded from the barcode passed as parameter bc. Note that bc is a barcode created by the
Barcode() method.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 21
GS1 Databar barcodes The GS1 DataBar symbology - formerly known as EAN.UCC Reduced Space Symbology (RSS) - is a family containing
three linear symbologies and three stacked variants, known as GS1-DataBar barcodes. GS1-DataBar-14 encodes the full
14 digit GS1/EAN/UCC item identification in a linear symbol that can be scanned in any direction. GS1-DataBar
Limited encodes item identification suitable for use on small items, but not for use at point-of-sale.
GS1-DataBar -Expanded encodes the 14 digit GS1/EAN/UCC item identification plus supplementary AI elements.
GS1-DataBar -14 Stacked is a variant which is stacked in two rows, either as a truncated version used for small item
marking,
or as an omni-directional version designed to be read by omnidirectional scanners.
The Databar Fonts
The Databar font system includes TrueType, OpenType and PostScript fonts for creating Databar barcodes by printing
characters to generate bars and spaces. Databar barcodes are made up of bars and spaces that may be 1 or more units
wide. The dL Databar fonts use the following ASCII characters:
22 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
A – P and a – f for the Databar modes Omnidirectional and Expanded (including the stacked variants)
0, 1 for the Truncated mode
2, 3 for the Limited mode
4 – 9 for the Stacked mode.
The minimum height of the bars in relation to the width of the thinnest bar is different for different modes, so for a given
point size the width of the characters is different. The height;width ratio for the characters is:
A – P and a-f: ratio = 1000 : 27
0, 1: ratio = 1000 : 77
2, 3: ratio = 1000 : 100
4 – 9 : ratio = 1000 : 143
The DBARDF DLL
To convert a string of characters into the bars and spaces required for the barcode requires converting the character string
into another string – made up of only the characters present in the dL Databar font.
The following DLLs will perform the conversion:
DBARDF.DLL – 32 bit ANSI version
DBARDFU.DLL – 32 bit Unicode version
DBARDF 64.DLL – 64 bit ANSI version
DBARDF64U.DLL – 64 bit Unicode version
The DLLs provide three function calls which can either return the required string, copy it to the clipboard, or save it to a
named disk file. These functions may be called from Visual Basic (including Visual Basic for Applications in Microsoft
Office), Visual C++, Visual Foxpro, Delphi, C++ Builder, and in fact virtually every language that can make DLL calls.
The functions are called with parameters that specify the options available for the barcode:
pMode – a pointer to an integer which specifies the type of Databar symbol required:
0 for Omnidirectional
1 for Truncated
2 for Limited
3 for Stacked
4 for Omnidirectional Stacked
5 for Expanded
6 for Expanded Stacked
szIn – is a pointer to a string containing the characters used as data to create the barcode.
pCols – a pointer to an integer which is either 0 or specifies the number of codeword pairs per row of an Expanded-
Stacked symbol – which may be 1 - 7.
Dbardf Function calls
The available function calls are:
BarsOutDb()
Creates the barcode in the device context hdc at coordinates xin,yin (in MM_TEXT units) using the properties specified.
Declared for C as
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 23
int WINAPI BarsOutDb(HDC hdc,int x, int y, LPTSTR szIn, int flags, int columns, int mode, int fontsize,LPTSTR
fontname);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
mode is and integer that specifies the mode for the barcode,
columns is an integer that specifies the number of columns in the symbol
flags is an integer that specifies additional characteristics, and
fontname is a pointer to a string which specifies the name, and fontsize is an integer that specifies the height (in Pixels)
of the font that will be used to render the barcode.
Bar2Drsf ()
- creates text for the Databar font and returns the text in szOut
Declared for C as
int WINAPI Bar2Drsf(LPINT mode, LPSTR szIn,LPINT cols, LPSTR szOut);
where mode is a pointer to an integer that specifies the barcode type required
szIn is a pointer to a string containing the text which is to be converted into the barcode;
cols is a pointer to an integer that specifies that number of codeword pairs per row in an Expanded-Stacked symbol,
and szOut is a pointer to a string which will receive the characters to be rendered in the dL Databar font.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Drsf Lib "dbardf" (ByRef mo As Long, ByVal szIn As String, ByRef co As Long, ByRef
szOut As String) As Long
Bar2Drsc ()
- creates text for the dL Databar font and copies it to the Windows clipboard
Declared for C as
int WINAPI Bar2Drsc(LPINT mode, LPSTR szIn,LPINT cols );
where mode is a pointer to an integer that specifies the barcode type required
szIn is a pointer to a string containing the text which is to be converted into the barcode;
cols is a pointer to an integer that specifies that number of codeword pairs per row in an Expanded-Stacked symbol,
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Drsc Lib "dbardf" (ByRef mo As Long, ByVal szIn As String, ByRef co As Long) As
Long
Bar2Drsw ()
- creates text for the dL Databar font and writes to file szFilename
Declared for C as
int WINAPI Bar2Drsw(LPINT mode, LPSTR szIn,LPINT cols, LPSTR szFilename);
where mode is a pointer to an integer that specifies the barcode type required
szIn is a pointer to a string containing the text which is to be converted into the barcode;
cols is a pointer to an integer that specifies that number of codeword pairs per row in an Expanded-Stacked symbol,
24 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
szFilename is a pointer to a string that contains the full pathname of the file to receive the text. If the file exists it will be
overwritten. If it does not exist it will be created if possible.
The call returns the number of bytes written to file, which is 0 in the event of a barcode creation error, or -1 in the event
of a file creation error.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Drsw Lib "dbardf" (ByRef mo As Long, ByVal szIn As String, ByRef co As Long, ByRef
szFilename As String) As Long
The Databar control
The DBAROCX control is an Active-X control which simplifies the use of barcodes in Active-X containers such as
Visual Basic and MS Access.
The DBAROCX control may be placed on a form in most applications which support Active-X controls, such as Visual
Basic, Microsoft Access, etc. The Databar barcode properties may be specified through a series of Properties, either via
programming, or by setting the properties in the control’s property pages.
Placing the Databar control on a form
Visual Basic
To add the control to a Visual Basic project select Components from the Project menu, then select DBAROCX Active-X
Control module from the list of controls displayed and push the OK button. The module’s icon will appear in the
Toolbox. The control may then be added to a form by clicking on the control’s icon and then drawing a rectangle for the
control on the required form.
If the control is to be visible then the area allowed should be large enough to hold the largest barcode required. If the
control is to be hidden, then the size is irrelevant.
Once added to a form, selection of the control will show the available properties in Visual Basic’s properties window.
VB.NET and C#
The control may be added to the Visual Studio Toolbox by right clicking on the Toolbox and selecting Add/Remove
Items (or Choose Items for VS 2005) from the pop-up menu displayed, then checking the control in the list presented.
The control will then appear as an icon on the Toolbox.
Access
To add the control to an Access Form or Report, open the form or report in Design view and ensure that the Toolbox is
visible (its on the View menu). Select the “More controls” icon on the Toolbox and then select the DBAROCX Active-
X Control module from the list of controls displayed. Draw a rectangle for the control on the from or report.
Once added to a form or report, selection of the control will show the available properties in Access’s properties
window. The font should be set by right-clicking on the control and choosing the Dbarocx control properties from the
displayed menu.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 25
Databar Control Property pages
The control also has its own property pages which may be accessed by right-clicking on the control and selecting
Properties from the displayed menu.
General Property page
This permits the setting of the barcode’s mode (Omnidirectional, Stacked, etc.) and (for Expanded Stacked symbols) the
number of codeword pairs per row, and allows the control to be set to resize itself each time it is drawn
Data Property page
The edit box on this page shows the data currently being used to generate the barcode image. It is useful only for
displayable characters.
Font Property page
This page allows the user to select the barcode font and font size used to generate the barcode.
Colors Property page
This page allows the user to specify the foreground (the bars) and background color of the barcode generated. In general
barcodes should be produced with a black foreground and a white background color.
The Databar Control Properties
The control has the following properties which may be set in the property pages or programmatically with Visual Basic.
Caption: (BSTR) the data which will be converted into a barcode
AutoSize: (Boolean) if non-zero causes the control to resize itself to contain the barcode.
BackColor: (Colorref) the background color
CapLength: (integer) normally 0.
Errorcode: (integer) a non-zero value is returned if the data supplied in the Caption property can be converted into a
valid barcode.
Font: (Font) the font in which the Output characters will be displayed
ForeColor: (Colorref) the color of the bars in the barcode
Mode: (integer) the mode of the barcode; Allowed values are:
0 for Omnidirectional
1 for Truncated
2 for Limited
3 for Stacked
4 for Omnidirectional Stacked
5 for Expanded
6 for Expanded Stacked
Output: (CString) the characters which when displayed in the correct font, produce the barcode. Note that this string
may be much larger than the Caption string.
In addition the control supports the normal Active-X properties, such as Visible, Height, Width, etc.
26 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Databar .NET Managed Component
Developer versions require the developer’s serial number to be passed to the component using the Serial property before
the Barcode() method is called. The Serial property should be set to the serial number provided for your product, e.g.
Dbarfnet1.Serial="12345" for VB
dbarfnet1.Serial="12345"; for C#
Use of an incorrect serial number will result in randomly scrambled symbols.
Main properties and methods are shown below; others are listed in the Common .NET component features section
Databar .NET Properties
Caption
Type: string
Default: "1234567890123"
Allowed values: Any text string.
Note: only text strings recognised as valid barcodes will result in a barcode picture. An Illegal character in the text string
will cause an Error value to be set.
CodeType
Type: bCode enumeration member
Default: bCode.Databar
Allowed values: bCode.Databar
This is the default value and should not be changed.
CodeTypeValue
Type: integer
Default: 0
Allowed values: 0
This is the default value and should not be changed.
Flag
Type: Boolean
Default: false
Allowed values: true or false
When Flag is set to true the Caption data is treated as a Unicode string and converted to a byte stream. When Flag is
false the Caption data is handled as described for the ByteNumber property.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 27
StartMode
Type: integer
Default: 0
Allowed values:
0 = Omnidirectional
1 = Truncated
2 = Limited
3 = Stacked
4 = Omnidirectional Stacked
5 = Expanded
6 = Expanded Stacked
Databar .NET Methods
Barcode()
Return Type: string
This method causes a barcode to be created as a sequence of character that, when displayed in the dL Databar font will
form the barcode symbol.
Note that the barcode symbol is determined only when this method is called, so the information properties are not set
until this method has been called.
28 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
QR Code barcodes QR Code is a matrix symbology consisting of a square array of modules with a finder pattern located at three corners. A
wide range of symbol sizes is supported along with four levels of error correction, and the symbology is noted for its
high data density.
The dLSoft libraries support QR Code Version 2 in Numeric, Alphanumeric and Byte modes. (Kanji mode is supported
by some but not all components).
The maximum data capacity of the symbols (at Level 0 error correction) are:
Numeric data 7089 digits
Alphanumeric data 4296 characters
Byte data 2953 bytes
Note that Alphanumeric includes digits and uppercase letters, the space and the $ % * + - . / : characters only.
The Reed-Solomon error correction allows the following recovery of damaged codewords:
Level 0: 7%
Level 1: 15%
Level 2: 25%
Level 3: 30%
Micro QR Code
The dLSoft Libraries also support Micro QR Code. Micro QR Code is a very small QR Code that fits applications that
require a smaller space and use smaller amounts of data, such as ID of printed circuit boards and electronics parts, etc.
The efficiency of data encoding has been increased with the use of only one position detection pattern.
The capacity of Micro QR Code symbols at the lowest error correction level is:
Numeric data 35 digits
Alphanumeric data 21 characters
Byte data 15 bytes
The QR Code Fonts
The QR font system includes TrueType and PostScript fonts for creating QR barcodes by printing characters to generate
bars and spaces. QR barcodes are made up of bars and spaces that may be 1 or more units wide. The dLSoft QR fonts
uses the ASCII characters 0 (zero) - z to represent 64 combinations of 6 bars and spaces as shown in the font table at the
end of this document, where a 1 is a bar and a 0 is a space. The individual characters are made up of six square in a
pattern 3 high by 2 wide, with each square representing a bit of a 6 bit binary value.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 29
The dLSoft QR fonts are provided in different weights, to allow for ink spread during wet ink printing and the line
broadening found in several printers designed for use with personal computers.
Font name weight
AZTW full size
AZTR 5% width reduction
AZTN 10% width reduction
(QR Code fonts are the same as the Aztec fonts)
Users should determine which font weight is suitable for their printer by testing each font weight. It should be noted that
if gaps between the font squares are clearly visible then the barcode will not scan correctly.
The DQRDF DLL
To convert a string of characters into the bars and spaces required for the barcode requires converting the character string
into another string – made up of only the 0 - z characters present in the QR font.
The following DLLs will perform the conversion:
DQRDF.DLL – 32 bit ANSI version
DQRDFU.DLL – 32 bit Unicode version
DQRDF64.DLL – 64 bit ANSI version
DQRDF64U.DLL – 64 bit Unicode version
The DLLs provide three function calls which can either return the required string, copy it to the clipboard, or save it to a
named disk file. These functions may be called from Visual Basic (including Visual Basic for Applications in Microsoft
Office), Visual C++, Visual Foxpro, Delphi, C++ Builder, and in fact virtually every language that can make DLL calls.
The functions are called with parameters that specify the options available for the barcode:
Code – a pointer to an integer which specifies the code type: 0 for QR Code, or 1 for Micro QR Code.
szIn – is a pointer to a string containing the bytes used as data to create the barcode. While passed as a text string, the
string can contain non-text bytes (including ASCII 0) provided that the length parameter (n) is used to specify the length
of the data. If n is 0, then the string is assumed to be a null-terminated ASCII string.
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0.
n – a pointer to an integer which is either 0 or specified the length of the data in szIn.
mode – a pointer to an integer specifying the mode of the QR Code barcode created. The allowed values are:
0 for Numeric mode
1 for Alphanumeric mode
2 for Byte mode
3 for Kanji mode.
Dqrdf Function calls
The available function calls are:
30 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
BarsOutQr()
Creates the barcode in the device context hdc at coordinates xin,yin (in MM_TEXT units) using the properties specified.
Declared for C as
int WINAPI BarsOutQr(HDC hdc,int x, int y, LPTSTR szIn, int code, int flags, int columns, int mode, int level, int
fontsize,LPTSTR fontname);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
code is an integer specifying the code type
mode is and integer that specifies the mode for the barcode,
columns is an integer that specifies the number of columns in the symbol
level is an integer that specifies the security level of the symbol
flags is an integer that specifies additional characteristics, and
fontname is a pointer to a string which specifies the name, and fontsize is an integer that specifies the height (in Pixels)
of the font that will be used to render the barcode.
Bar2Dqrf ()
- creates text for the QR Code font and returns the text in szOut
Declared for C as
int WINAPI Bar2Dqrf(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT sec, LPINT mode, LPSTR szOut);
int WINAPI Bar2Dqrf2(LPINT code, LPSTR szIn,LPINT n, LPINT columns, LPINT flags, LPINT sec, LPINT mode,
LPSTR szOut);
where code specifies the barcode type required (0 for QR Code, 1 for Micro QR Code)
szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is normally 0; otherwise it may be the number of characters in the string if the string is to be interpreted as a byte
stream,
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0..
mode specifies the mode, sec is the security level and szOut is a pointer to a string which will receive the characters to be
rendered in the QR (AZT) font.
The security level has allowed values of 0 – 3 for all modes for QR Code, or 0 – 2 for Micro QR Code.
The columns parameter in the Bar2Dqrf2 call may be used specify the size of the barcode as the number of elements
across the symbol.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dqrf Lib "dqrdf" (ByRef c As Long, ByVal szIn As String, ByRef n As Long, ByRef flg,
ByRef sec As Long, ByRef mo As Long, ByRef szOut As String) As Long
Bar2Dqrc ()
- creates text for the QR font and copies it to the Windows clipboard
Declared for C as
int WINAPI Bar2Dqrc(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT sec, LPINT mode );
int WINAPI Bar2Dqrc2(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT sec, LPINT mode );
where code specifies the barcode type required (0 for QR Code, 1 for Micro QR Code)
szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is normally 0; otherwise it may be the number of characters in the string if the string is to be interpreted as a byte
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 31
stream,
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0..
mode specifies the mode, sec is the security level and szOut is a pointer to a string which will receive the characters to be
rendered in the QR (AZT) font.
The security level has allowed values of 0 – 3 for all modes for QR Code, or 0 – 2 for Micro QR Code.
The columns parameter in the Bar2Dqrc2 call may be used specify the size of the barcode as the number of elements
across the symbol.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dqrc Lib "dqrdf" (ByRef c As Long, ByVal szIn As String, ByRef n As Long, ByRef fl,
ByRef sec As Long, ByRef mo As Long) As Long
Bar2Dqrw ()
- creates text for the QR font and writes to file szFilename
Declared for C as
int WINAPI Bar2Dqrw(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT sec, LPINT mode, LPSTR
szFilename);
int WINAPI Bar2Dqrw2(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT sec, LPINT mode,
LPSTR szFilename);
where code specifies the barcode type required (0 for QR Code, 1 for Micro QR Code)
szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is normally 0; otherwise it may be the number of characters in the string if the string is to be interpreted as a byte
stream,
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0..
mode specifies the mode, sec is the security level. The security level has allowed values of 0 – 3 for all modes for QR
Code, or 0 – 2 for Micro QR Code.
szFilename is a pointer to a string that contains the full pathname of the file to receive the text. If the file exists it will be
overwritten. If it does not exist it will be created if possible.
The call returns the number of bytes written to file, which is 0 in the event of a barcode creation error, or -1 in the event
of a file creation error.
The columns parameter in the Bar2Dqrw2 call may be used specify the size of the barcode as the number of elements
across the symbol.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dqrw Lib "dqrdf" (ByRef c As Long, ByVal szIn As String, ByRef n As Long, ByRef fl,
ByRef sec As Long, ByRef mo As Long, ByRef szFilename As String) As Long
Bar2Dqrd ()
- decodes text strings previously encoded using Bar2Dqrf(),Bar2Dqrc(), or Bar2Dqrw().
Declared for C as
32 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
int WINAPI Bar2Dqrd(LPSTR szIn, LPSTR szOut);
where szIn is a pointer to a string containing the barcode which is to be decoded;
szOut is a pointer to a string that will receive the decoded output.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dqrd Lib "aztdf" (ByVal szIn As String, ByRef szOut As String) As Long
The QR control
The QROCX control is an Active-X control which simplifies the use of barcodes in Active-X containers such as Visual
Basic and MS Access.
The QROCX control may be placed on a form in most applications which support Active-X controls, such as Visual
Basic, Microsoft Access, etc. The QR barcode properties may be specified through a series of Properties, either via
programming, or by setting the properties in the control’s property pages.
Placing the QR control on a form
Visual Basic 6
To add the control to a Visual Basic project select Components from the Project menu, then select QROCX Active-X
Control module from the list of controls displayed and push the OK button. The module’s icon will appear in the
Toolbox. The control may then be added to a form by clicking on the control’s icon and then drawing a rectangle for the
control on the required form.
If the control is to be visible then the area allowed should be large enough to hold the largest barcode required. If the
control is to be hidden, then the size is irrelevant.
Once added to a form, selection of the control will show the available properties in Visual Basic’s properties window.
VB.NET and C#
The control may be added to the Visual Studio Toolbox by right clicking on the Toolbox and selecting Add/Remove
Items (or Choose Items for VS 2005 or later) from the pop-up menu displayed, then checking the control in the list
presented. The control will then appear as an icon on the Toolbox.
Access
To add the control to an Access Form or Report, open the form or report in Design view and ensure that the Toolbox is
visible (its on the View menu). Select the “More controls” icon on the Toolbox and then select the QROCX Active-X
Control module from the list of controls displayed. Draw a rectangle for the control on the from or report.
Once added to a form or report, selection of the control will show the available properties in Access’s properties
window. The font should be set by right-clicking on the control and choosing the QRocx control properties from the
displayed menu.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 33
QR Control Property pages
The control also has its own property pages which may be accessed by right-clicking on the control and selecting
Properties from the displayed menu.
General Property page
This permits the setting of the barcode’s mode (Numeric, Alphanumeric, Byte) and security level properties, and allows
the control to be set to resize itself each time it is drawn
Data Property page
The edit box on this page shows the data currently being used to generate the barcode image. It is useful only for
displayable characters. To provide data which includes non-printable characters the Caption property should be set via
programming.
Font Property page
This page allows the user to select the barcode font and font size used to generate the barcode.
Colors Property page
This page allows the user to specify the foreground (the bars) and background color of the barcode generated. In general
barcodes should be produced with a black foreground and a white background color.
The QR Control Properties
The control has the following properties which may be set in the property pages or programmatically with Visual Basic.
Caption: (BSTR) the data which will be converted into a barcode
CodeType: (integer) 0 specifies QR Code, 1 specifies Micro QR Code.
AutoSize: (Boolean) if non-zero causes the control to resize itself to contain the barcode.
BackColor: (Colorref) the background color
CapLength: (integer) normally 0, in which case the length of the data string in the Caption property is determined
automatically. If non-zero it is taken to be the number of characters in the Caption property to be used as data.
Errorcode: (integer) a non-zero value is returned if the data supplied in the Caption property can be converted into a
valid barcode.
Flags: (integer) if bit 7 is set (ie 128) the data is encoded as Unicode, otherwise as ANSI. Note it is not necessary to set
this Flag for Kanji mode.
Font: (Font) the font in which the Output characters will be displayed
ForeColor: (Colorref) the color of the bars in the barcode
Level: (integer, 0 - 3) the security level for the generated barcode (see the DLL above for a description)
Columns: (integer) the number of elements across the barcode symbol; 11-17 for Micro QR symbols, 21 – 177 for QR
Code symbols.
Mode: (integer) the mode used to generate the barcode;
0 for Numeric mode
1 for Alphanumeric mode
34 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
2 for Byte mode
3 for Kanji mode.
Note: it is not necessary to set the Flags bit 7 when encoding in Kanji mode.
Output: (CString) the characters which when displayed in the correct font, produce the barcode. Note that this string
may be much larger than the Caption string.
In addition the control supports the normal Active-X properties, such as Visible, Height, Width, etc.
QR Code .NET Managed Component
Developer versions require the developer’s serial number to be passed to the component using the Serial property before
the Barcode() method is called. The Serial property should be set to the serial number provided for your product, e.g.
Qrcnet1.Serial="12345" for VB
qrcnet1.Serial="12345"; for C#
Use of an incorrect serial number will result in randomly scrambled symbols.
Main properties and methods are shown below; others are listed in the Common .NET component features section
QR.NET Properties
ByteNumber
Type: integer
Default: 0
Allowed values: 0 – barcode byte capacity
When ByteValue is greater than 0 the Caption string (which is a Unicode string) is unpacked into 8-bit ASCII characters
before the data is used to generate the barcode – ie. Only the low-order byte of each character is used.
When ByteNumber is 0 the Caption string is converted to bytes according to the length of each character in the string.
(see also Flag)
Caption
Type: string
Default: "0123456789"
Allowed values: Any text string.
Note: only text strings recognised as valid barcodes will result in a barcode picture. An Illegal character in the text string
will cause an Error value to be set.
CodeType
Type: bCode enumeration member
Default: bCode.QRCode
Allowed values: bCode.QRCode, bCode,MicroQR
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 35
CodeTypeValue
Type: integer
Default: 0
Allowed values: 0 or 1
The barcode type can be set using either the CodeType property or the CodeTypeValue property
Columns.
Type: integer
Default: 0
Allowed values: 11-17 for Micro QR Code symbols; 21 – 177 for QR Code Symbols. Any other value is ignored.
Flag
Type: Boolean
Default: false
Allowed values: true or false
When Flag is set to true the Caption data is treated as a Unicode string and converted to a byte stream. When Flag is
false the Caption data is handled as described for the ByteNumber property.
StartMode
Type: integer
Default: 0
Allowed values:
0 = Numeric mode
1 = Alphanumeric mode
2= Byte mode
3=Kanji mode
SecurityLevel
Type: integer
Default: 0
Allowed values: 0 - 3. (0 – 2 for Micro QR Code symbols)
QR.NET Methods
Barcode()
Return Type: string
This method causes a barcode to be created as a sequence of character that, when displayed in the AZTx font will form
the barcode symbol.
36 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Note that the barcode symbol is determined only when this method is called, so the information properties are not set
until this method has been called.
BarDecode(string bc)
Return Type: string
This method returns a string decoded from the barcode passed as parameter bc. Note that bc is a barcode created by the
Barcode() method.
PDF417 barcodes PDF417 (Portable Data File 417) is a stacked barcode symbology capable of encoding over a kilobyte of data in a
symbol.
PDF417 may include extensive error-correction enabling data to be recovered from a symbol that has been damaged or
corrupted.
There are 900 different patterns (codewords) which may be incorporated into a PDF417 symbol, and several modes
available for encoding.
Encoding Modes
EXC (Extended Alphanumeric Compaction mode) - allows encoding of all printable ASCII characters into about 2
characters per codeword. Within the EXC mode there are several submodes:
Binary/ASCII Plus mode - allows encoding of 256 international characters including the full ASCII set plus any 8-bit
value in the range 0 - 255. This mode allows encoding approximately 1.2 bytes per codeword and so is considerable less
efficient than EXC mode.
Numeric mode - allows encoding of a string of digits with a density of approximately 2.95 digits per codeword.
Recommended where more than 13 digits are to be encoded. Numeric mode symbols may not contain non-numeric
characters.
The maximum capacity of PDF417 symbols is approximately as follows:
Numeric mode – maximum capacity 2700 digits*
Alphanumeric text – maximum capacity 1800 characters*
Byte values – maximum capacity 1100 bytes
*Note that capital letters, punctuation, mode shifts and new lines/paragraphs reduce these value.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 37
Security level
One of PDF417’s most valuable features is its ability to allow correction of errors. This ability is provided by the
inclusion of additional codewords within the symbol, so that the data codewords may be reconstructed even if some are
defaced or misread.
The number of damaged codewords (Nmax) which may be recovered depends on the security level (which in turn
determines the number of additional characters included in the symbol)
Security level Nmax
0 0
1 2
2 6
3 14
4 30
5 62
6 126
7 154
8 510
Aspect ratio
PDF417 symbols may be reproduced with different number of codewords per row, and therefore in several different
height to width ratios.
The user may select either target ratio (as the height to width ratio) or the required number of codewords per row. In
general tall, thin barcodes read more reliably than short, wide symbols, although there may be restrictions applied by the
type of barcode scanner employed.
Appended symbols are not supported at this time.
Micro PDF 417
MicroPDF417 is a multi-row symbology based on PDF417 designed for applications requiring a greater area efficiency
but lower data capacity than PDF417. A specific and limited set of symbol sizes is available, each size including a fixed
level of error correction.
MicroPDF417 provides for three encoding modes: Text, Byte and Numeric compaction. Text is for general text,
Numeric for encoding data consisting only of digits, and Byte to allow for the first 127 ASCII characters but with a
reduced level of efficiency. Four symbol widths are permitted, each specifying the number of data columns (1 – 4).
Within each symbol width a variable number of rows provide for a maximum data capacity of:
Text compaction mode 0: 250 characters (2 data characters per codeword)
Byte compaction mode 1: 150 characters (1.2 data characters per codeword)
Numeric compaction mode 2: 366 characters (2.93 data characters per codeword)
The Level parameter for MicroPDF barcodes set the number of data columns within the barcode, which may be 1 – 4.
The industry standard Macro sequences [)>{RS}05{GS} and [)>{RS}06{GS} are supported (where {RS} represents
ASCII 30 and {GS} is ASCII 29).
The following character translations are made when the value of the mode parameter is increase by 8.
38 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
String converted to
{ET} ASCII 4
{FS} ASCII 28
{GS} ASCII 29
{RS} ASCII 30
Appended symbols are not supported at this time.
The PDF font
The PDF417 font system includes TrueType and PostScript fonts for creating PDF barcodes by printing characters to
generate bars and spaces. PDF barcodes are made up of bars and spaces that may be 1 to 8 units wide. The dLSoft PDF
fonts uses the characters 0 (zero) - z to represent 64 combinations of 6 bars and spaces as shown in the font table at the
end of this document, where a 1 is a bar and a 0 is a space, arranged as a 6 bit binary number.
The dLSoft PDF fonts are provided in four element height/width ratios:
Font name element height/width ratio
PD2x 2 : 1
PD3x 3 : 1
PD4x 4 : 1
PD5x 5 : 1
The dLSoft fonts are also provided in different weights, to allow for ink spread during wet ink printing and the line
broadening found in several printers designed for use with personal computers.
Font name weight
PDnW full size
PDnR 8% width reduction
PDnN 16% width reduction
Users should determine which font weight is suitable for their printer by testing each font weight.
The PDFDF DLL
To convert a string of characters into the bars and spaces required for the barcode requires converting the character string
into another string – made up of only the characters present in the PDF font.
PDFDF.DLL – 32 bit ANSI version
PDFDFU.DLL – 32 bit Unicode version
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 39
PDFDF64.DLL – 64 bit ANSI version
PDFDF64U.DLL – 64 bit Unicode version
The DLLs provide three function calls which can either return the required string, copy it to the clipboard, or save it to a
named disk file. These functions may be called from Visual Basic (including Visual Basic for Applications in Microsoft
Office), Visual C++, Visual Foxpro, Delphi, C++ Builder, and in fact virtually any language that can make DLL calls.
The functions are called with parameters that specify the options available for the barcode:
Code – a pointer to an integer that specifies the barcode type:
Code parameter Symbol type
0 PDF417 barcodes
1 MicroPDF barcodes
2 Truncated PDF417
szIn – is a pointer to a string containing the bytes used as data to create the barcode. While passed as a text string, the
string can contain non-text bytes (including ASCII 0) provided that the length parameter (n) is used to specify the length
of the data. If n is 0, then the string is assumed to be a null-terminated ASCII string.
n – a pointer to an integer which is either 0 or specified the length of the data in szIn.
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0.
columns – a pointer to an integer which specifies the number of codeword columns in the barcode pattern generated.
Allowed values are 0 – 100. For PDF417 values less than 3 are ignored. For MicroPDF only values 1 – 4 are permitted.
level – a pointer to an integer specifying the security level of the barcode generated. Allowed values are shown in the
table above.
start – a pointer to an integer specifying the mode in which the barcode starts. The allowed values are shown below.
Start parameter Start mode
0 EXC Alpha
1 EXC Lower
2 EXC Mixed
3 EXC Punctuation.
4 Binary/ASCII Plus
5 Numeric mode
For MicroPDF barcodes the Start parameter (or Compaction mode) may be
Start Parameter Start Mode
0 Text compaction
1 Byte compaction
2 Numeric compaction
40 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Pdfdf Function calls
The available function calls are:
BarsOutPd()
Creates the barcode in the device context hdc at coordinates xin,yin (in MM_TEXT units) using the properties specified.
Declared for C as
int WINAPI BarsOutPd(HDC hdc,int x, int y, LPTSTR szIn, int code, int flags, int columns, int mode, int level, int
fontsize,LPTSTR fontname);
where szIn is a pointer to a string containing the text which is to be converted into the barcode;
code is an integer specifying the code type
mode is and integer that specifies the mode for the barcode,
columns is an integer that specifies the number of columns in the symbol
level is an integer that specifies the security level of the symbol
flags is an integer that specifies additional characteristics, and
fontname is a pointer to a string which specifies the name, and fontsize is an integer that specifies the height (in Pixels)
of the font that will be used to render the barcode.
Bar2Dpdf ()
- creates text for PDF font and returns text in szOut
Declared for C as
int WINAPI Bar2Dpdf(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT level, LPINT start,
LPSTR szOut);
where code is a pointer to an integer that holds the codetype either 0 (for PDF417 barcodes), 1 (for MicroPDF barcodes)
or 2 (for Truncated PDF417).
szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0.
columns – a pointer to an integer which specifies the number of codeword columns in the barcode pattern generated.
Allowed values are 0 – 100. For PDF417 values less than 3 are ignored. For MicroPDF only values 1 – 4 are permitted.
level is the security level,
start is the mode in which the barcode should start (normally 0), and
szOut is a pointer to a string which will receive the characters to be rendered in the PDF font.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dpdf Lib "pdfdf" (ByRef cd As Long, ByVal szIn As String, ByRef n As Long, ByRef flg
As Long, ByRef ap As Long, ByRef lv As Long, ByRef st As Long, ByRef szOut As String) As Long
Bar2Dpdc ()
- creates text for PDF font and copies to the Windows clipboard
Declared for C as
int WINAPI Bar2Dpdc(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT level, LPINT start);
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 41
where code is a pointer to an integer that holds the codetype either 0 (for PDF417 barcodes), 1 (for MicroPDF barcodes)
or 2 (for Truncated PDF417).
szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0.
columns – a pointer to an integer which specifies the number of codeword columns in the barcode pattern generated.
Allowed values are 0 – 100. For PDF417 values less than 3 are ignored. For MicroPDF only values 1 – 4 are permitted.
level is the security level, and
start is the mode in which the barcode should start (normally 0).
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dpdc Lib "pdfdf" (ByRef cd As Long, ByVal szIn As String, ByRef n As Long, ByRef flg
As Long,ByRef ap As Long, ByRef lv As Long, ByRef st As Long) As Long
Bar2Dpdd ()
- decodes text strings previously encoded using Bar2Dpdf(),Bar2Dpdc(), or Bar2Dpdw().
Declared for C as
int WINAPI Bar2Dpdd(LPSTR szIn, LPSTR szOut);
where szIn is a pointer to a string containing the barcode which is to be decoded;
szOut is a pointer to a string that will receive the decoded output.
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dpdd Lib "aztdf" (ByVal szIn As String, ByRef szOut As String) As Long
Bar2Dpdw ()
- creates text for PDF font and writes to file szFilename
Declared for C as
int WINAPI Bar2Dpdw(LPINT code, LPSTR szIn,LPINT n, LPINT flags, LPINT columns, LPINT level, LPINT start,
LPSTR szFilename);
where code is a pointer to an integer that holds the codetype either 0 (for PDF417 barcodes), 1 (for MicroPDF barcodes)
or 2 (for Truncated PDF417).
szIn is a pointer to a string containing the text which is to be converted into the barcode;
n is the number of characters in the string (or 0 – in which case the string may not contain NULL characters),
flags – may be used in the Unicode versions to force encoding the data as Unicode by setting bit 7 to 1. (ie. 128).
Otherwise this value should be 0.
columns – a pointer to an integer which specifies the number of codeword columns in the barcode pattern generated.
Allowed values are 0 – 100. For PDF417 values less than 3 are ignored. For MicroPDF only values 1 – 4 are permitted.
start is the mode in which the barcode should start (normally 0),
level is the security level, and
szFilename is a pointer to a string which contains the full pathname of a file to receive the string of characters which
represent the barcode when rendered in the PDF font.
The call returns the number of bytes written to file, which is 0 in the event of a barcode creation error, or -1 in the event
of a file creation error.
42 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Basic Declaration (VB6 & VBA)
Private Declare Function Bar2Dpdw Lib "pdfdf" (ByRef cd As Long, ByVal szIn As String, ByRef n As Long, ByRef
flg As Long, ByRef ap As Long, ByRef lv As Long, ByRef st As Long, ByRef szFilename As String) As Long
The PDF417 control
The PDFOCX control is an Active-X control which simplifies the use of barcodes in Active-X containers such as Visual
Basic and MS Access.
ThePDFOCX control may be placed on a form in most applications which support Active-X controls, such as Visual
Basic, Microsoft Access, etc. The PDF417 barcode properties may be specified through a series of Properties, either via
programming, or by setting the properties in the control’s property pages.
Placing the PDF417 control on a form
Visual Basic 6
To add the control to a Visual Basic project select Components from the Project menu, then select PDFOCX Active-X
Control module from the list of controls displayed and push the OK button. The module’s icon will appear in the
Toolbox. The control may then be added to a form by clicking on the control’s icon and then drawing a rectangle for the
control on the required form.
If the control is to be visible then the area allowed should be large enough to hold the largest barcode required. If the
control is to be hidden, then the size is irrelevant.
Once added to a form, selection of the control will show the available properties in Visual Basic’s properties window.
VB.NET and C#
The control may be added to the Visual Studio Toolbox by right clicking on the Toolbox and selecting Add/Remove
Items (or Choose Items for VS 2005 or later) from the pop-up menu displayed, then checking the control in the list
presented. The control will then appear as an icon on the Toolbox.
Access
To add the control to an Access Form or Report, open the form or report in Design view and ensure that the Toolbox is
visible (its on the View menu). Select the “More controls” icon on the Toolbox and then select the PDFOCX Active-X
Control module from the list of controls displayed. Draw a rectangle for the control on the from or report.
Once added to a form or report, selection of the control will show the available properties in Access’s properties
window. The font should be set by right-clicking on the control and choosing the Pdfocx control properties from the
displayed menu.
PDF417 Property pages
The control also has its own property pages which may be accessed by right-clicking on the control and selecting
Properties from the displayed menu.
General Property page
This permits the setting of the barcode’s type and encoding mode, aspect ratio and security level properties, and allows
the control to be set to resize itself each time it is drawn. Note that unlike the DLL the columns value specified on the
property pages is the real (floating point) value, eg. 1.0 or 0.5, etc.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 43
Data Property page
The edit box on this page shows the data currently being used to generate the barcode image. It is useful only for
displayable characters. To provide data which includes non-printable characters the Caption property should be set via
programming.
Font Property page
This page allows the user to select the barcode font and font size used to generate the barcode.
Colors Property page
This page allows the user to specify the foreground (the bars) and background color of the barcode generated. In general
barcodes should be produced with a black foreground and a white background color.
The PDF417 Control Properties
The control has the following properties which may be set in the property pages or programmatically with Visual Basic.
CodeType: (integer) 0 for PDF417, 1 for MicroPDF barcodes, or 2 for Truncated PDF.
Caption: (BSTR) the data which will be converted into a barcode
Columns: (Real, Single precision) the number of dataword columns in the displayed barcode.
AutoSize: (Boolean) if non-zero causes the control to resize itself to contain the barcode.
BackColor: (Colorref) the background color
CapLength: (integer) normally 0, in which case the length of the data string in the Caption property is determined
automatically. If non-zero it is taken to be the number of characters in the Caption property to be used as data.
Errorcode: (integer) a non-zero value is returned if the data supplied in the Caption property can be converted into a
valid barcode.
Flags: (integer) if bit 7 is set (ie 128) the data is encoded as Unicode, otherwise as ANSI.
Font: (Font) the font in which the Output characters will be displayed
ForeColor: (Colorref) the color of the bars in the barcode
SecurityLevel: (integer) the security level for the generated barcode (see the DLL above for a description)
StartMode: (integer) the mode used to generate the barcode (see the DLL above for a description).
Output: (CString) the characters which when displayed in the correct font, produce the barcode. Note that this string
may be much larger than the Caption string.
In addition the control supports the normal Active-X properties, such as Visible, Height, Width, etc.
PDF417 .NET Managed Component
Developer versions require the developer’s serial number to be passed to the component using the Serial property before
the Barcode() method is called. The Serial property should be set to the serial number provided for your product, e.g.
Pdfnet1.Serial="12345" for VB
pdfnet1.Serial="12345"; for C#
Use of an incorrect serial number will result in randomly scrambled symbols.
44 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Main properties and methods are shown below; others are listed in the Common .NET component features section
PDF417.NET Properties
ByteNumber
Type: integer
Default: 0
Allowed values: 0 – barcode byte capacity
When ByteValue is greater than 0 the Caption string (which is a Unicode string) is unpacked into 8-bit ASCII characters
before the data is used to generate the barcode – ie. Only the low-order byte of each character is used.
When ByteNumber is 0 the Caption string is converted to bytes according to the length of each character in the string.
(see also Flag)
Caption
Type: string
Default: "0123456789"
Allowed values: Any text string.
Note: only text strings recognised as valid barcodes will result in a barcode picture. An Illegal character in the text string
will cause an Error value to be set.
CodeType
Type: bCode enumeration member
Default: bCode.PDF417
Allowed values: bCode.PDF417, bCode.MicroPDF or bCode.Truncated
CodeTypeValue
Type: integer
Default: 0
Allowed values: 0 ( for PDF417) or 1 (for MicroPDF) or 2 (for Truncated)
The barcode type can be set using either the CodeType property or the CodeTypeValue property
Columns
Type: integer
Default: 3
Allowed values: 3 – 12
Specifies the number of Data codeword columns in a PDF417 symbol (ie. NOT including the columns of start and stop
bars). Note: This does NOT apply to MicroPDF symbols, who shape is determined by the security level.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 45
Flag
Type: Boolean
Default: false
Allowed values: true or false
When Flag is set to true the Caption data is treated as a Unicode string and converted to a byte stream. When Flag is
false the Caption data is handled as described for the ByteNumber property.
StartMode
Type: integer
Default: 0
Allowed values:
For PDF417 symbols:
Start parameter Start mode
0 EXC Alpha
1 EXC Lower
2 EXC Mixed
3 EXC Punctuation.
4 Binary/ASCII Plus
5 Numeric mode
For MicroPDF barcodes the StartMode parameter (or Compaction mode) may be
Start Parameter Start Mode
0 Text compaction
1 Byte compaction
2 Numeric compaction
SecurityLevel
Type: integer
Default: 0
Allowed values: 0 - 8. for PDF417; 1 – 4 for MicroPDF.
PDF417.NET Methods
Barcode()
Return Type: string
46 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
This method causes a barcode to be created as a sequence of character that, when displayed in the PDxx font will form
the barcode symbol.
Note that the barcode symbol is determined only when this method is called, so the information properties are not set
until this method has been called.
BarDecode(string bc)
Return Type: string
This method returns a string decoded from the barcode passed as parameter bc. Note that bc is a barcode created by the
Barcode() method.
Common DLL features The following calls is common to several font kit DLLs. The XX in the call name is different for each kit as shown
below to avoid problems when more than one DLL is used within an application.
Aztec DLLs, XX = AZ
Databar DLLs, XX = DB
Datamatrix DLLs, XX = DM
PDF417 DLLs, XX = PD
QRCode DLLs, XX = QR
ErrorMessXX()
The ErrorMessXX() function call to the DLL is declared in C as
Int WINAPI ErrorMessXX(LPINT errorcode, LPSTR errortext)
And is use to obtain in errortext the text string corresponding to the error code pointed to by errorcode.
Note that the buffer pointed to by errortext must be declared as at least 36 characters (ie TCHAR errortext[36]) to
received the error messages.
Applies to all font kits.
EnumModeXX()
The EnumModeXX() function call to the DLL is declared in C as
Int WINAPI EnumModeXX(LPINT mode, LPSTR modename)
And is use to obtain in mode the text string corresponding to the mode value pointed to by mode.
Note that the buffer pointed to by modename must be declared as at least 36 characters (ie TCHAR errortext[36]) to
received the error messages.
Calls to EnumModeXX return the value of mode if the mode exists, or -1 otherwise.
Applies to all font kits.
MaxLevelXX()
The MaxLevelXX() function call to the DLL is declared in C as
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 47
Int WINAPI MaxLevelXX(LPINT mode)
And returns the maximum value of the sercurity level that may be used with the specified mode, or -1 if the mode does
not exist.
Applies to Aztec, Datamatrix, PDF417 and QR Code kits.
Common .NET component features
Using .NET Components in Visual Studio
Adding a .NET Component to the ToolBox To add a 2D-Font kit Component to the Visual Studio ToolBox, display the ToolBox and select the Components tab.
Right click on the Components pane and select Add/Remove Items (or Choose Items) from the pop-up menu displayed.
A dialog box is displayed listing the currently installed components. Ensure that the .NET Framework Components page
is displayed.
Push the Browse button and navigate to the location where you have installed or copied your .NET component and select
the DLL (e.g. Aztnet.dll).
Then push the Open button.
The list of installed components is now displayed, including your 2D-font.NET component. Ensure that the checkbox
alongside the component name is checked. Now push the OK button.
The component appears as an icon on the ToolBox Components pane, with one of the following class names alongside:
Component .NET name DLL
Aztec Font Kit.NET Aztnet Aztnet.dll
Datamatrix Font.NET Dmfnet Dmfnet.dll
QR Code Font.NET Qrcnet Qrcnet.dll
PDF417 Font.NET Pdfnet Pdfnet.dll
Adding a .NET component to a project. With a project's form open in design mode drag the .NET component icon from the toolbox onto the form.
The component icon appears on the panel below the form – it does NOT appear on the form itself. The instance of the
component will be given a default name (eg Aztnet1) which appears in the properties panel when the component is
selected. A single Form may contain any number of .NET Components. The first to be added will be called Aztnet1, the
second Aztnet2, and so on; the names may be changed by the user by modifying the Name property within the Properties
box.
The properties panel also displays all other settable properties for the component, and these values will be used as
defaults unless properties are changed programmatically within your project.
48 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Setting and retrieving property values programmatically The .NET Components may be operated entirely by setting or retrieving Property values programmatically.
Clicking on the Barcode Component in the panel under the form when Visual Studio's Properties box is displayed will
show the current settings for component's available properties. Most of these may be edited using the Properties box, or
may have their values set from within the user's program by statements of the kind
Aztnet1.Caption="123456789" Visual Basic
Abcnet1.Caption="123456789"; C#
The Component properties that are set AFTER a barcode has been created may be retrieved within user's
programs by statements of the kind:
x=Aztnet1.Error Visual Basic
x=Aztnet1.Error; C#
Setting properties through the Barcode properties dialog box Using the Method Properties() causes the Barcode properties dialog to be displayed. This displays all settable properties
in a convenient form and enables changes to be made by selecting from drop-down lists or entering values into edit
boxes.
The example shown above is for the PDF417 Font Kit
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 49
Displaying a barcode on a form To display a barcode on a form a TextBox is used to hold the characters and the Font property of the TextBox set to a
suitable size of the relevant font (eg. AZTW or PD3W).
For example:
Private Sub DoBarcode() Visual Basic
Abcnet1.Caption="123456789
TextBox1.Texte=Aztnet1.Barcode()
End Sub
private void DoBarcode() C#
{
aztnet1.Caption="123456789";
textBox1.Text=aztnet1.Barcode();
}
Printing a barcode
Printing the text returned by the Barcode() call may be accomplished by any of the printing techniques available for
Visual Studio project. However, probably the most useful approach is to use the DrawString() method in a PrintPage
handler as illustrated below, and in the example provided with the components:
Visual Basic
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim br As Brush
Dim ff As New Font(“AZTW”, 8, FontStyle.Regular)
br = New SolidBrush(Color.Black)
e.Graphics.PageUnit = GraphicsUnit.Document '
e.Graphics.DrawString(Aztnet1.barcode(), ff, br, 100.0F, 300.0F)
' Indicate that this is the last page to print.
e.HasMorePages = False
End Sub
While the PageUnit setting can be any of the allowed values, the example above uses the highest resolution setting
(Document, equivalent to 300 units per inch).
Licensing the component The .NET components will behave as Testware versions (generating scrambled barcode and pattern strings) unless
correctly licensed.
Single computer version of the components are licensed for use only on a single computer. Developer versions permit
applications built with the.NET components to be distributed up to a maximum distribution of 10,000 copies.
50 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
Developer versions require the developer’s serial number to be passed to the component using the Serial property before
the Barcode() method is called. The Serial property should be set to the serial number provided for your product, e.g.
Aztnet1.Serial="12345" for VB
aztnet1.Serial="12345"; for C#
.NET Information properties
Note that the barcode symbol is determined only when this Barcode() method is called, so the information properties are
not available until this method has been called.
Error
Type: integer
Returns a value representing the error code if a valid barcode image cannot be created. Otherwise returns 0.
Read only. Do not set this property.
The error codes and corresponding Status property values are shown below:
Status
Type: string
Returns a string interpreting the value of the Error property.
The error codes and corresponding Status property values are shown below:
Error Status
0 OK
1 Illegal character in data
2 Wrong data length
3 Error in barcode data
9 Other error
Read only. Do not set this property.
Pattern
Type: String
Returns: A string containing a pattern of digit characters which represent the bars and spaces in the barcode
symbol.
Read only. Do not set this property.
The pattern string returned for a PDF417 symbol consists of the sequence of digits used to represent the thickness of bars
and spaces alternately in the symbol (starting with the first bar), arranged by row. Bar height is at the user’s choice. Each
row is separated by a newline (\n or CHR(10)) characters.
The pattern string returned for an Aztec, Datamatrix or QR Code symbol consists of the sequence of characters used to
create the symbol, arranged by row, with a ‘1’ for a black square and a ‘0’ for a white square. Each row is separated by a
newline (\n or CHR(10)) characters.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 51
.NET Component Methods
Barcode()
Return Type: string
This method causes a barcode to be created as a string of characters that, when displayed in the AZTx font will form the
barcode symbol.
Note that the barcode symbol is determined only when this method is called, so the information properties are not set
until this method has been called.
Properties()
Return Type: BOOL
Displays the Barcode properties dialog for the component.
Returns TRUE if the user exits the dialog by pushing the OK button and sets all component properties to those specified
in the dialog.
Returns FALSE if the user exits the dialog by pushing the Cancel button.
.NET Standard components The .NET Standard components share most of the properties with the .NET components described above and have been
built to the .Net Standard 2.0. Note that only Developer licence versions of the kits can use .NET Standard components.
The components may be distinguished from the normal components by the s at the end of the name, so the components
are:
Component .NET name
Aztec Font Kit.NET Aztnets
Datamatrix Font.NET Dmfnets
QR Code Font.NET Qrcnets
PDF417 Font.NET Pdfnets
These components do not include a Properties dialog, so all properties must be set through code.
A sample demo application (using VB.Net and .Net v 4.6.2) and source code is included and will be found in the NetStd
folder of the samples.
Common Control Features All the controls have property pages that may be displayed and which enable properties to be set by the user.
52 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
The example shown above is for the Datamatrix ont Kit.
Common control methods
The following methods are common to all font kit OCX controls.
BarSave()
Int BarSave(LPSTR filename)
Causes the control to save the barcode characters into a text file. Filename must be the fully qualified file name,
complete with .TXT extension – such as that available from the Windows SaveDialog control.
The methods returns the number of bytes saved in the file, or 0 if an error occurs.
VB Example:
Ff$=”C:\test.txt”
BarSave(Ff$)
BarCopy()
Int BarCopy(void)
Copies the barcode text to the Windows clipboard, from where it may be pasted into other applications.
Note that only the text is copied; pasted text will need to be set into the appropriate font before a barcode will be seen.
VB Example
BarCopy()
GetModeName()
BSTR GetModeName(LPINT mode) for Aztec and DataMatrix font kits.
BSTR GetModeName(LPINT code, LPINT mode) for the PDF font kit, where the code parameter contains 0 for
PDF417 barcodes or 1 for Micro PDF barcodes.
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 53
Return the name of 2D mode for the barcode type. For example, DataMatrix barcodes have the mode name “Square” for
mode=0 and “Rectangular” for mode=1.
An invalid value in mode will return an empty string, so this method may be used for enumerating the available modes;
for example:
For i = 0 To 10
x$ = Aztocx1.GetModeName(i)
If (Len(x$) > 0) Then
Combomode.AddItem (x$)
Else
Exit For
End If
Next
GetMaxLevel()
Int GetMaxLevel(LPINT mode) for Aztec and DataMatrix font kits.
Int GetMaxLevel(LINT code. LPINT mode) for the PDF font kit, where the code parameter contains 0 for PDF417
barcodes or 1 for Micro PDF barcodes.
Returns the number of security levels valid for the mode. For example, Aztec in Normal mode can have 99 levels, but in
Compact mode has only 4.
VB Example
Mode=0
N=GetMaxLevel(Mode)
GetError()
BSTR GetError(LPINT errorcode)
The GetError(Errorcode) method returns the text (a BSTR string) of the error message corresponding to the Errorcode
value. So a string variable may be filled with the error message using
X$=Uniocx1.GetError(Uniocx.Errorcode)
Using with CreateObject While the components can be added to applications at design-time (as described in the sections above) they may also be
created at run-time using CreateObject.
A simple example of code is shown here for a VB6 application consisting of a form containing a TextBox:
Public abc As Object
Private Sub Form_Load()
Set abc = CreateObject("AZTOCX.AztocxCtrl.1")
abc.Caption = "Hello World"
Text2.Text = abc.Output
End Sub
54 2D-Barcode Fonts dLSoft 2D-Barcode Fonts
When the form loads the abc object is created, some of its properties are specified, then the resulting barcode characters
placed in the TextBox.
The string in the CreateObject function is the Class name of the component. The Table below shows the class names for
the Barcode 2D-Font Kit Component classes.
Aztec Font Kit AZTOCX.AztocxCtrl.1
Databar Font Kit DBAROCX.DbarocxCtrl.1
Datamatrix Font Kit DMFOCX.DmfocxCtrl.1
PDF417 Font Kit PDFOCX.PdfocxCtrl.1
QR Code Font Kit QROCX.QRocxCtrl.1
Objects created this way may have their properties set in code or by providing a call to one of the components methods,
such as
Abc.ShowProps
Error Codes A negative value returned from the Bar2Dxxf() calls indicates one of the following errors:
1 Invalid data length
2 Invalid code type
3 Invalid parameters
4 Illegal character in data
5 Invalid embedded code
6 Line width too small
7 Font error
8 Error creating image
9 Error creating barcode
Font table The characters representing the barcode elements are shown in the following Font table.
value binary char value binary char value binary char
0 000000 0 21 010101 E 42 101010 Z
1 000001 1 22 010110 F 43 101011 [
2 000010 2 23 010111 G 44 101100 \
3 000011 3 24 011000 H 45 101101 ]
4 000100 4 25 011001 I 46 101110 ^
5 000101 5 26 011010 J 47 101111 _
6 000110 6 27 011011 K 48 110000 `
dLSoft 2D-Barcode Fonts 2D-Barcode Fonts 55
7 000111 7 28 011100 L 49 110001 a
8 001000 8 29 011101 M 50 110010 b
9 001001 9 30 011110 N 51 110011 c
10 001010 : 31 011111 O 52 110100 d
11 001011 ; 32 100000 P 53 110101 e
12 001100 < 33 100001 Q 54 110110 f
13 001101 = 34 100010 R 55 110111 g
14 001110 > 35 100011 S 56 111000 h
15 001111 ? 36 100100 T 57 111001 i
16 010000 @ 37 100101 U 58 111010 j
17 010001 A 38 100110 V 59 111011 k
18 010010 B 39 100111 W 60 111100 l
19 010011 C 40 101000 X 61 111101 m
20 010100 D 41 101001 Y 62 111110 n
21 010101 E 42 101010 Z 63 111111 o
Characters < to @ (ANSI 60 – 64) are reproduced at p to t (ANSI 112-116)
Characters [ to ‘ (ANSI 91 – 96) are reproduced at u to z (ANSI 117-122)
These alternative characters are used by version 3 of our libraries to avoid difficulties with programs that interpret
characters such as < and > and ^ as control characters.
dLSoft 2D-Barcode Fonts Index 57
Index
.
.NET Component Methods 51
.NET Information properties 50
.NET Standard components 51
2
2D-Barcode fonts 1
A
Access 7, 15, 24, 32, 42
Adding a .NET component to a project. 47
Adding a .NET Component to the ToolBox 47
Aspect ratio 37
AzFlag 8
AzMenu 8
AzRvideo 8
Aztdf Function calls 4
Aztec .NET Managed Component 8
Aztec barcodes 2
Aztec Control Properties 7
Aztec Property pages 7
Aztec.NET Methods 10
Aztec.NET Properties 8
B
Bar2Dazc () 5
Bar2Dazd () 6
Bar2Dazf () 5
Bar2Dazw () 5
Bar2Ddmc () 14
Bar2Ddmd () 15
Bar2Ddmf () 13
Bar2Ddmw () 14
Bar2Dpdc () 40
Bar2Dpdd () 41
Bar2Dpdf () 40
Bar2Dpdw () 41
Bar2Dqrc () 30
Bar2Dqrd () 31
Bar2Dqrf () 30
Bar2Dqrw () 31
Bar2Drsc () 23
Bar2Drsf () 23
Bar2Drsw () 23
Barcode() 10, 20, 27, 35, 45, 51
BarCopy() 52
BarDecode(string bc) 10, 20, 36, 46
BarSave() 52
BarsOutAz() 4
BarsOutDb() 22
BarsOutDm() 13
BarsOutPd() 40
BarsOutQr() 30
ByteNumber 8, 18, 34, 44
C
Caption 9, 18, 26, 34, 44
CodeType 9, 18, 26, 34, 44
CodeTypeValue 9, 19, 26, 35, 44
Colors Property page 7, 16, 25, 33, 43
Columns 44
Columns. 35
Common .NET component features 47
Common Control Features 51
Common Control Methods 52
Common DLL features 46
D
Data Property page 7, 16, 25, 33, 43
Databar .NET Managed Component 26
Databar .NET Methods 27
Databar .NET Properties 26
Databar Control Property pages 25
Datamatrix .NET Managed Component 17
DataMatrix barcodes 10
DataMatrix font 11
DataMatrix Property pages 16
Datamatrix.NET Methods 20
Datamatrix.NET Properties 18
Dbardf Function calls 22
DeutschePost 19
Displaying a barcode on a form 49
Dmatdf Function calls 13
Dqrdf Function calls 29
E
Encoding Modes 36
EnumModeXX() 46
Error 50
Error Codes 54
ErrorMessXX() 46
58 Index dLSoft 2D-Barcode Fonts
F
Flag 9, 19, 26, 35, 45
Font Property page 7, 16, 25, 33, 43
Font table 54
G
General Property page 7, 16, 25, 33, 42
GetError() 53
GetMaxLevel() 53
GetModeName() 52
GS1 Databar barcodes 21
GS1_Flag 19
I
Installing additional fonts 2
Introduction 1
L
Licensing the component 49
M
MaxLevelXX() 46
Micro PDF 417 37
Micro QR Code 28
P
Pattern 50
PDF417 .NET Managed Component 43
PDF417 barcodes 36
PDF417 Property pages 42
PDF417.NET Methods 45
PDF417.NET Properties 44
Pdfdf Function calls 40
Placing the Aztec control on a form 6
Placing the Databar control on a form 24
Placing the Datamatrix control on a form 15
Placing the PDF417 control on a form 42
Placing the QR control on a form 32
PostFlag 19
PostMatrix 11
Printing a barcode 49
Properties() 51
Q
QR Code .NET Managed Component 34
QR Code barcodes 28
QR Control Property pages 33
QR.NET Methods 35
QR.NET Properties 34
S
Security and Layers 3
Security level 37
SecurityLevel 9, 20, 35, 45
Setting and retrieving property values programmatically
48
Setting properties through the Barcode properties dialog
box 48
StartMode 9, 19, 27, 35, 45
Status 50
T
The AZTDF DLL 4
The Aztec control 6
The Aztec font 3
The Databar control 24
The Databar Control Properties 25
The Databar Fonts 21
The Datamatrix control 15
The DataMatrix Control Properties 16
The DBARDF DLL 22
The DMATDF DLL 11
The DQRDF DLL 29
The PDF font 38
The PDF417 control 42
The PDF417 Control Properties 43
The PDFDF DLL 38
The QR Code Fonts 28
The QR control 32
The QR Control Properties 33
U
Using .NET Components in Visual Studio 47
Using with CreateObject 53
V
VB.NET and C# 6, 15, 24, 32, 42
Visual Basic 24
Visual Basic 6 6, 15, 32, 42
W
Windows 7 2
Windows 8/10 2
Windows XP/2003/Vista 2