PDF stands for “Portable Data File.” A two-dimensional symbology (2D), a single PDF417 symbol carries up to 1.1 kilobytes of machine-readable data in a space no larger than a standard bar code. And, unlike one-dimensional bar codes (1D), which are just a key linked to a database, PDF417 symbols contain the database itself. That means, you don't have to store an article number in the barcode but you can also store the name , the size , the color, the name of the manufacturer etc...
Data Matrix is a two-dimensional (2D) matrix symbology which is made up of square modules arranged within a perimeter finder pattern. It can encode up to 3116 characters from the entire 256 byte ASCII character set. The symbol consists of data regions which contain square modules set out in a regular array. Large ECC 200 symbols contain several regions. Each data region is delimited by a finder pattern, and this is surrounded on all four sides by a quiet zone border (margin).
ECC 200 symbols have an even number of rows and an even number of columns. Most of the symbols are square with sizes from 10 x 10 to 144 x 144. Some symbols however are rectangular with sizes from 8 x 18 to 16 x 48. All ECC 200 symbols can be recognized by the upper right corner module being light (binary 0).
ECC200 is the newest version of data matrix and supports advanced encoding error checking and correction algorithms (reed-solomon). This algorithms allow the recognition of barcodes that are up to 60% damaged.
The barcode supports two optional mechanisms:
RDataMatrix supports:
RDataMatrix supports all data matrix formats. The following table contains the size , the capacity and the correction error features of each format:
Size |
Numeric Capacity |
Alphanumeric capacity |
Binary capacity |
Max Correctable Error/Erasure |
10 x 10 |
6 |
3 |
1 |
2 |
12 x 12 | 10 | 6 | 3 | 3 |
14 x 14 | 16 | 10 | 6 | 5/7 |
16 x 16 | 24 | 16 | 10 | 6/9 |
18 x 18 |
36 |
25 |
16 |
7/11 |
20 x 20 | 44 | 31 | 20 | 9/15 |
22 x 22 |
60 |
43 |
28 |
10/17 |
24 x 24 |
72 |
52 |
34 |
12/21 |
26 x 26 |
88 |
64 |
42 |
14/25 |
32 x 32 | 124 | 91 | 60 | 18/33 |
36 x 36 | 172 | 127 | 84 | 21/39 |
40 x 40 | 228 | 169 | 112 | 24/45 |
44 x 44 | 288 | 214 | 142 | 28/53 |
48 x 48 | 348 | 259 | 172 | 34/65 |
52 x 52 | 408 | 304 | 202 | 42/78 |
64 x 64 | 560 | 418 | 278 | 56/106 |
72 x 72 | 736 | 550 | 366 | 72/132 |
80 x 80 | 912 | 682 | 454 | 96/180 |
88 x 88 | 1152 | 862 | 574 | 112/212 |
96 x 96 | 1392 | 1042 | 694 | 136/260 |
104 x 104 | 1632 | 1222 | 814 | 168/318 |
120 x 120 | 2100 | 1573 | 1048 | 204/390 |
132 x 132 | 2608 | 1954 | 1302 | 248/472 |
144 x 144 | 3116 | 2335 | 1556 | 310/590 |
8 x 18 | 10 | 6 | 3 | 3 |
8 x 32 | 20 | 13 | 8 | 5 |
12 x 26 | 32 | 22 | 14 | 7/11 |
12 x 36 | 44 | 31 | 20 | 9/15 |
16 x 36 | 64 | 46 | 30 | 12/21 |
16 x 48 | 98 | 72 | 47 | 14/25 |
The data represented in the symbol can be compressed using one or several of the following algorithms:
All encoding system can be used to encode any data, but for example, encoding binary data with C40 generates much more overhead (longer symbol) than with BASE256.
RDataMatrix uses the tilde character ~ to recognize some special characters in the input data. The following possibilities are available:
After unzipping the file you have received or downloaded, you must add one of the following files to your IDE ( for example, Visual Studio.Net or #develop):
The files are located in the net1_1 and the net1_0 subdirectories.
Whenever you use one of our controls don't forget to import the namespace:
[C#]
using J4L.RBarcode;
...
[VBNET]
Imports J4L.RBarcode
.....
The product contains a sample application (and its c# source code) which demonstrates the use of the windows forms control. The source code of the sample application is located in the FormExample subdirectory .
The compiled version is located under the net1_0 (compiled with .NET 1.0.3705 ) and the net1_1 (compiled with .NET 1.1.4322 ) subdirectories .
The Example application will allow you to create any type of barcodes, save them to a gif file of print them. In the main window you must select the type of barcode you want to create.
In the next windows you can then enter the barcode specific information and create the barcode.
(Note: all examples use the Rbarcode1D class, however you can use RDatamatrix and RPDF417 classes in the same way)
The windows forms control can be placed on a form with your IDE by just adding our controls to the toolbox. You can also programmatically add controls to your form with the following code:
[C#]
using J4L.RBarcode;
...
// define variable
Rbarcode1D bc;
// create instance of the objact
bc = new Rbarcode1D();
// define position and size of the object on the form
bc.Location = new System.Drawing.Point(8, 8);
bc.Size = new System.Drawing.Size(368, 176);// set barcode properties
bc.Code="12345678";
bc.BarType=Rbarcode1D.tbarType.CODE128;
// add it to the form "this" is the current form.
this.Controls.Add(bc);[VBNET]
Imports J4L.RBarcode
.....
' define variable
dim bc as Rbarcode1D
'create instance of the objact
bc = new Rbarcode1D()
'define position and size of the object on the form
bc.Location = new System.Drawing.Point(8, 8)
bc.Size = new System.Drawing.Size(368, 176)' set barcode properties
bc.Code="12345678"
bc.BarType=Rbarcode1D.tbarType.CODE128
'add it to the form "me" is the current form.
me.Controls.Add(bc)
If you need to created a image file you can do it like this:
[C#]
using J4L.RBarcode;
...
// define variable
Rbarcode1D bc;
// create instance of the objact
bc = new Rbarcode1D();
// set barcode properties
bc.Code="12345678";
bc.BarType=Rbarcode1D.tbarType.CODE128;
// set size and write to file
bc.Size = new System.Drawing.Size(368, 176);
bc.saveToFile("file.gif","GIF");
[VBNET]
Imports J4L.RBarcode
......
' define variable
Dim bc as Rbarcode1D
'create instance of the objact
bc = new Rbarcode1D()
' set barcode properties
bc.Code="12345678"
bc.BarType=Rbarcode1D.tbarType.CODE128
' set size and write to file
bc.Size = new System.Drawing.Size(368, 176)
bc.SaveToFile("file.gif","GIF")
You can also use the paintBarcode method for rendering the barcode onto an external Graphics object:
[C#]
using J4L.RBarcode;
using System.Drawing;...
// create image and graphics
Bitmap inMemoryImage =new Bitmap(300,300) ;
Graphics g= Graphics.FromImage(inMemoryImage) ;
// create barcode
Rbarcode1D bc=new Rbarcode1D();// set barcode properties
bc.Code="12345678";
bc.BarType=Rbarcode1D.tbarType.CODE128;
// render barcode on "g"
bc.paintBarcode(g);[VBNET]
Imports J4L.RBarcode
Imports System.Drawing..............
' create image and graphics
dim inMemoryImage as new Bitmap(300,300)
dim g as Graphics = Graphics.FromImage(inMemoryImage)
'create barcode
dim bc as Rbarcode1D =new Rbarcode1D()' set barcode properties
bc.Code="12345678"
bc.BarType=Rbarcode1D.tbarType.CODE128
'render barcode on "g"
bc.paintBarcode(g)
You can print the barcode by rendering in on the Graphics objects of the PrintDocument:
[C#]
void btnPrintClick(object sender, System.EventArgs e)
{
// create PrintDocument and set handler
PrintDocument printDocument1=new PrintDocument();
printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
printDocument1.Print();
}private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
// print barcode here
bc.paintBarCode(e.Graphics);
}
(Note: all examples use the Rbarcode1DWeb class, however you can use RDatamatrixWeb and RPDF417Web classes in the same way)
The Web Controls can be used in 2 ways:
<img SRC=barcode.aspx ALT=Barcode BORDER=0>
which defines a image that must be read from barcode.aspx. The barcode.aspx page must then generate the barcode image in the following way:
[C#]
<%@ Page language="c#" AutoEventWireup="false" Trace="false" Debug="false" %>
<%@Import Namespace="System.Drawing" %>
<%@Import Namespace="System.IO" %>
<%@Import Namespace="System.Drawing.Imaging" %>
<%@Import Namespace="J4L.RBarcode" %>
<%@ OutputCache Duration="100" VaryByParam="none" %>
<%
// define variable
Rbarcode1DWeb bc;
// create instance of the object
bc = new Rbarcode1DWeb();// set barcode properties
bc.Code="12345678";
bc.BarType=Rbarcode1DWeb.tbarType.CODE128;// create in memory image
Bitmap inMemoryImage = new Bitmap( 200,200);
Graphics g = Graphics.FromImage(inMemoryImage);
// paint barcode
bc.paintBarcode(g);MemoryStream tempStream = new MemoryStream();
// output image to the memory stream in gif format
inMemoryImage.Save(tempStream,ImageFormat.Gif);Response.ClearContent();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "image/gif";
Response.BinaryWrite(tempStream.ToArray());
Response.End();
%>[VBNET]
<%@ Page language="VB" AutoEventWireup="false" Trace="false" Debug="false" %>
<%@Import Namespace="System.Drawing" %>
<%@Import Namespace="System.IO" %>
<%@Import Namespace="System.Drawing.Imaging" %>
<%@Import Namespace="J4L.RBarcode" %>
<%@ OutputCache Duration="100" VaryByParam="none" %>
<%
' define variable
dim bc as Rbarcode1DWeb = new Rbarcode1DWeb()' set barcode properties
bc.Code="12345678"
bc.BarType=Rbarcode1DWeb.tbarType.CODE128' create in memory image
dim inMemoryImage as Bitmap= new Bitmap( 200,200)
dim g as Graphics = Graphics.FromImage(inMemoryImage)
' paint barcode
bc.paintBarcode(g)dim tempStream as MemoryStream = new MemoryStream()
' output image to the memory stream in gif format
inMemoryImage.Save(tempStream,ImageFormat.Gif)Response.ClearContent()
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "image/gif"
Response.BinaryWrite(tempStream.ToArray())
Response.End()
%>
Methods
- paintBarcode(graphics): render barcode.
- saveToFile(filename as string,format as string): saves the barcodes to a file, format can be GIF, PNG or JPEG.
Properties
- BarType: this is the type of barcode to be used. Valid values are:
- Rbarcode1D.tbarType.BAR39
- Rbarcode1D.tbarType.BAR39EXT
- Rbarcode1D.tbarType.CODE11
- Rbarcode1D.tbarType.CODABAR
- Rbarcode1D.tbarType.CODE93EXT
- Rbarcode1D.tbarType.CODE128
- Rbarcode1D.tbarType.MSI
- Rbarcode1D.tbarType.IND25
- Rbarcode1D.tbarType.MAT25
- Rbarcode1D.tbarType.INTERLEAVED25
- Rbarcode1D.tbarType.EAN13
- Rbarcode1D.tbarType.EAN8
- Rbarcode1D.tbarType.POSTNET
- Rbarcode1D.tbarType.UPCA
- Rbarcode1D.tbarType.UPCE .
- BarBackColor: back color of the barcode.
- BarForeColor: color of the bars.
- BarHeight:: height of the bars in pixels. If this value is 0, it will be calculated using H.
- BarCODABARStartChar: Start character for CODABAR. Valid values are "A", "B", "C" or "D".
- BarCODABARStopChar: Stop character for CODABAR. Valid values are "A", "B", "C" or "D".
- Code: this is the value to be encoded.
- BarCode128set: set of charaters to be used in code128. Valid values are : tCode128Type.code128A , tCode128Type.code128B and tCode128Type.code128C.
- BarCheckCharacter : If true the software will calculate the check character automatically.
- BarFontColor: color of the font used to display the code.
- BarguardBars: indicates if guardbars will be height than other bars. Only for EAN and UPC.
- Isize: intercharacter separator , only for BAR39. A value of 1 means that the separator will have the same length as X.
- Hsize: Indicates how to calculate the height of the bars. A value of 0.5 means that the bars should be half the length of the symbol.
- BarLeftMargin: left margin in pixels.
- Nsize: a value of 2, means that wide bars will be 2 times the width of narrow bars. The default vaue is 2.
- BarPostnetHeightTallBar: height (in pixels) of PostNet's tall bar.
- BarPostnetHeightShortBar: height (in pixels) of PostNet's short bar.
- BarSupHeight: relative height of the supplement's bars (only EAN and UPC). The default (0.8) means 80% of the normal bars.
- BarSupSeparation: separation between the code and the supplement (in pixels). the default is 10(only EAN and UPC).
- BarFont: font used to display the code.
- BarTopMargin: top margin in pixels.
- BarUPCEANSupplement2: indicates if the codes EAN and UPC will have a 2 digit's supplement.
- BarUPCEANSupplement5: indicates if the codes EAN and UPC will have a 5 digit's supplement.
- BarUPCESystem: encoding system to be used for UPCE, valid values are tUPCESystem.cSystem0 and tUPCESystem.cSystem1
- Xsize: width in pixels of narrow bars. The default is 1.
- ImageRetainTime(only Rbarcode1DWeb): image files will be deleted from server after X minutes. This parameter defines the number of minutes.This parameter applies only if you use approach 1 for the server control
- ImageHTMLPrefix (only Rbarcode1DWeb): this the image's directory from the browser's point of view. This is the directory in the IMG tag of the html code. This parameter applies only if you use approach 1 for the server control
- LocalImageDirectory (only Rbarcode1DWeb): this is the directory where the image files (gif files) will be created if you use approach 1 for the server control .
How to use the checkCharacter property:
If you are suppling the code with the check digit already calculated, you must set BarCheckCharacter to false. If you want the software to calculate the checksum for you, you must set barcheckCharacter to true (default).For EAN and UPC have fixed length and therefore you only have the following possibilities:
- EAN13: you supply a 13 digits code and set barcheckCharacter to false or you supply a 12 digits code and set barcheckCharacter to true.
- EAN8: you supply a 8 digits code and set barcheckCharacter to false or you supply a 7 digits code and set barcheckCharacter to true.
- UPCA and UPCE: you supply a 12 digits code and set barcheckCharacter to false or you supply a 11digits code and set barcheckCharacter to true.
Methods
- paintBarCode(graphics): render barcode.
- saveToFile(filename as string,format as string): saves the barcodes to a file, format can be GIF, PNG or JPEG.
Properties
- PaintedWidth (readonly): real size of the barcode. The value is set after the barcode is painted. Can be use to create an image of the exact size.
- PaintedHeight (readonly): real size of the barcode. Can be use to create an image of the exact size.
- PDFBackColor: background color.
- PDFForColor: foreground color (color of the bars).
- PDFBarHeight: height in pixels of the bars (default is 7).
- PDFBarWidth: width in pixels of the bars (default is 1).
- PDFCode: string to be encoded.
- PDFColumns: number of columns of the PDF417 symbol (default is 10)
- PDFRows: number of rows of the PDF417 symbol (default is 0). If 0 the number is automatically calulated.
- PDFECLevel: Error correction level (default is 0). Valid values are 0, 1, 2, 3, 4 and 5.
- PDFLeftMargin: left margin in pixels (default is 10).
- PDFTopMargin: top margin in pixels (default is 10).
- PDFMode: encoding mode (default is binary). Valid values are:
- tCompaction.PDF_BINARY
- tCompaction.PDF_NUMERIC
- tCompaction.PDF_TEXT
- ImageRetainTime(only RPDF417Web): image files will be deleted from server after X minutes. This parameter defines the number of minutes.This parameter applies only if you use approach 1 for the server control
- ImageHTMLPrefix (only RPDF417Web): this the image's directory from the browser's point of view. This is the directory in the IMG tag of the html code. This parameter applies only if you use approach 1 for the server control
- LocalImageDirectory (only RPDF417Web): this is the directory where the image files (gif files) will be created if you use approach 1 for the server control .
Methods
- paintBarcode(graphics): render barcode.
- saveToFile(filename as string,format as string): saves the barcodes to a file, format can be GIF, PNG or JPEG.
Properties
- ApplyTilde: process the " ~ " in the string to be encoded.
- BarBackColor: background color.
- BarForeColor: foreground color (color of the pixels).
- Code: string to be encoded.
- Encoding: encoding to be used:
- tEncoding.E_ASCII
- tEncoding.E_C40
- tEncoding.E_TEXT
- tEncoding.E_BASE256
- tEncoding.E_NONE
- tEncoding.E_AUTO
- PreferredFormat: format to be used:
- t.DSize.CAUTO (default)
- t.DSize.C10X10
- t.DSize.C12X12
- t.DSize.C14X14
- t.DSize.C16X16
- t.DSize.C18X18
- t.DSize.C20X20
- t.DSize.C22X22
- t.DSize.C24X24
- t.DSize.C26X26
- t.DSize.C32X32
- t.DSize.C36X36
- t.DSize. C40X40
- t.DSize.C44X44
- t.DSize.C48X48
- t.DSize.C52X52
- t.DSize.C64X64
- t.DSize.C72X72
- t.DSize.C80X80
- t.DSize.C88X88
- t.DSize.C96X96
- t.DSize.C104X104
- t.DSize.C120X120
- t.DSize.C132X132
- t.DSize.C144X144
- t.DSize. C8X18
- t.DSize.C8X32
- t.DSize.C12X26
- t.DSize.C12X36
- t.DSize.C16X36
- t.DSize.C16X48
- PaintedWidth (readonly): real size of the barcode. The value is set after the barcode is painted. Can be use to create an image of the exact size.
- PaintedHeight (readonly): real size of the barcode. Can be use to create an image of the exact size.
- BarLeftmargin: left margin in pixels (default is 10).
- BarTopMargin: top margin in pixels (default is 10).
- DotsPixel: size of the dots (in pixels) of the matrix.
- ImageRetainTime(only RDatamatrixWeb): image files will be deleted from server after X minutes. This parameter defines the number of minutes.This parameter applies only if you use approach 1 for the server control
- ImageHTMLPrefix (only RDatamatrixWeb): this the image's directory from the browser's point of view. This is the directory in the IMG tag of the html code. This parameter applies only if you use approach 1 for the server control
- LocalImageDirectory (only RDatamatrixWeb): this is the directory where the image files (gif files) will be created if you use approach 1 for the server control .