ActiveBarcode for developers http://www.activebarcode.com/
Content About this manual...1 Setup ActiveBarcode...2 Visual Studio 2012 Barcodes in projects...3 Visual Basic Barcodes in projects...8 Visual C# and C++ Barcodes in projects...13 Delphi 2005 XE2 Barcodes in projects...19 Delphi 4 7 Barcodes in projects...24 VisualBasicScript Barcodes in projects...28 JavaScript Barcodes in projects...29 Lotus Domino, LotusScript Barcodes in projects...30 Access 2010 Barcodes in reports...31 Access 2010 Barcodes in Forms...36 Access 2007 Barcodes in reports...40 Access 2007 Barcodes in Forms...45 Access 2000, XP, 2003 Barcodes in reports...48 Access 2000, XP, 2003 Barcodes in forms...52 ActiveBarcode Control (OCX)...56 Property Dialog: General...58 Property Dialog: Fonts...60 Property Dialog: Colors...62 Property Dialog: Layout...63 ActiveBarcode Commandline Tool...65 Barcode types...68 OCX: Properties...72 OCX: Methods...74 OCX: Events...76 Property: Text...77 i
Content Property: ShowText...78 Property: Type...79 Property: Rotate...85 Property: Alignment...86 Property: TypeName...87 Property: IsValid...88 Property: IsSizeOk...89 Property: Checksum...90 Property: Picture...91 Property: BackColor...92 Property: ForeColor...93 Property: Font...94 Property: Version...95 Property: BorderHeight...96 Property: BorderWidth...97 Property: MaxBorderHeight...98 Property: MaxBorderWidth...99 Property: NotchHeightInPercent...100 Property: PrintFix...101 Property: AutoType...102 Method: CopyToClipboard...103 Method: CopyToClipboardBySize...104 Method: CreatePictureBySize...105 Method: SaveAs...106 Method: SaveAsBySize...107 Method: SaveAsBySizeExtended...108 ActiveBarcode Control: Image file options...110 ii
Content Method: SetDemoText...112 Method: AboutBox...113 Method: BinaryWriteAsPNGBySize...114 Method: BinaryWriteAsPNG...115 Method: SaveAsPNG...116 Method: SaveAsPNGBySize...117 Event: TypeChange...118 Event: TextChange...119 Event: ShowTextChange...120 Event: AutoTypeChange...121 Event: PrintFixChange...122 Information for developers...123 iii
About this manual This present documentation is a shortened version of the extensive online documentation. This document outer finally concentrates on the topic ActiveBarcode for developers You find the complete documentation at ours homepage http://www.activebarcode.com/. There you find detailed and current information examples for download extensive step by step instructions example videos a detailed FAQ and much more Important note to the 64bit version of Office 2010 and 2013: The ActiveBarcode Control is 32bit and can be used with the 32bit (x86) version of Office 2010/2013 only. Microsoft itself recommends to install the 32bit (x86) instead of the 64bit (x64) version of the Office 2010 package. This is valid, even if you use a 64bit (x64) operating system. All trademarks and product names mentioned are the property of their respective owners. ActiveBarcode Software Lars Schenk & Frank Horn This document Frank Horn Dokument Version 2.0.270 About this manual 1
Setup ActiveBarcode How to setup ActiveBarcode to your machine: If you already have an ActiveBarcode installation on your system (e.g. if you tried the trial and have now purchased the full version), please uninstall before installing. You need administrator's rights for the installation. If you don't have them, ask your administrator to install the software. Now launch the setup file ActiveBarcode5.60.exe or when setting up the trial it's the file ActiveBarcode Trial5.60.exe. If you have downloaded a ZIP archive, first extract the file from the archive. The setup application will then be launched. The setup, the control and the Application is digital signed by 'Lars Schenk'. Follow the instructions of this setup application. You even can cancel the setup process using the "Cancel" button. After the setup is complete the ActiveBarcode Control is available now in your system and in addition to this you can now start the ActiveBarcode Application form your Startmenu > Programs. Please consider that the ActiveBarcode Control is more flexible and more powerful than the ActiveBarcode Application! You can find instructions of how to use ActiveBarcode Control with diffent software here: Examples Setup ActiveBarcode 2
Visual Studio 2012 Barcodes in projects To use this functionality you require the Enterprise Edition How to add a barcode to a Visual Studio 2012 project You can use the ActiveBarcode control in Visual Studio 2012 like you do with any other control, e.g. a button. First you have to add the ActiveBarcode control into the development environment. Adding ActiveBarcode to the development environment Go to the menu "Tools" and select the function "Choose Toolbox items": A dialog appears. As ActiveBarcode is a COM component first select the tab "COM Components". A list of the available controls will be displayed. Select "ActiveBarcode" and activate it. Then click OK. Now ActiveBarcode is added to your development environment. Use ActiveBarcode (A simple example) Visual Studio 2012 Barcodes in projects 3
Create a new project. To add the ActiveBarcode Control to a form you select the function "Toolbox" from the "View" menu first. This opens the toolbox. "Toolbox". Have a look for the ActiveBarcode Control in the toolbox now. Click on ActiveBarcode there and move it the form you want to place the control. The control will then be placed on this form. You can change the barcode properties of the barcode control now or later. In this example we change the background color to white: Visual Studio 2012 Barcodes in projects 4
Now add a "Textbox" to this form, too. Double click this textbox now to open the source code for the event "Textchange". We will use this event to change the barcodes content every time the textbox changes. Visual Studio 2012 Barcodes in projects 5
This code example is for Visual Basic. With Visual C# you use the following code for the assignment og the text property: axbarcode1.text = textbox1.text; That's it. Now launch this example application: If you change the content of the textbox in the running application, the barcode will encode this. Not visual usage of ActiveBarcode: You also can create ActiveBarcode at run time and use the the control: In the following example ActiveBarcode is created invisible, then a Code 128 with the encoded content "Example" is generated and saved as image file by using the SaveAsBySize function. Visual Studio 2012 Barcodes in projects 6
Visual Basic: Dim MyObject As Object MyObject = CreateObject("BARCODE.BarcodeCtrl.1") MyObject.text = "Example" MyObject.typename = "Code 128" MyObject.SaveAsBySize("example.bmp", 400, 100) Visual C#: BARCODELib.Barcode ab = new BARCODELib.Barcode(); ab.text = "123456789012"; ab.typename = "EAN 13"; ab.saveasbysize("example.bmp", 400, 150); This manual was created by Frank Horn Visual Studio 2012 Barcodes in projects 7
Visual Basic Barcodes in projects To use this functionality you require the Enterprise Edition How to add a barcode to a Visual Basic project You can use ActiveBarcode in Visual Basic like any other control (e.g. like a button). First you have to add the ActiveBarcode control into the development environment. Adding ActiveBarcode to the development environment Go to the menu "Tools" and select the function "Choose Toolbox items": A dialog appears. As ActiveBarcode is a COM component first select the tab "COM Components": A list of the available controls will be displayed. Select "ActiveBarcode" and activate it. Then click OK. Visual Basic Barcodes in projects 8
Now ActiveBarcode is added to your development environment. Use ActiveBarcode (A simple example) Create a new project. To add the ActiveBarcode Control to a form you select the function "Toolbox" from the "View" menu first. This opens the toolbox. "Toolbox": Have a look for the ActiveBarcode Control in the toolbox now. Visual Basic Barcodes in projects 9
Click on ActiveBarcode there and move it the form you want to place the control. The control will then be placed on this form. You can change the barcode properties of the barcode control now or later. In this example we change the background color to white: Visual Basic Barcodes in projects 10
Now add a "Textbox" to this form, too. Double click this textbox now to open the source code for the event "Textchange". We will use this event to change the barcodes content every time the textbox changes. That's it. Now launch this example application: Visual Basic Barcodes in projects 11
If you change the content of the textbox in the running application, the barcode will encode this. Not visual usage of ActiveBarcode: You also can create ActiveBarcode at run time and use the the control: In the following example ActiveBarcode is created invisible, then a Code 128 with the encoded content "Example" is generated and saved as image file by using the SaveAsBySize function. Dim MyObject As Object MyObject = CreateObject("BARCODE.BarcodeCtrl.1") MyObject.text = "Example" MyObject.typename = "Code 128" MyObject.SaveAsBySize("example.bmp", 400, 100) This manual was created by Frank Horn Visual Basic Barcodes in projects 12
Visual C# and C++ Barcodes in projects To use this functionality you require the Enterprise Edition How to add a barcode to a Visual C# or C++ project You can use ActiveBarcode in Visual C# and C++ like any other control (e.g. like a button). First you have to add the ActiveBarcode control into the development environment. Adding ActiveBarcode to the development environment In this example, Visual C# is used. The procedure in Visual C++ is nearly identical. Go to the menu "Tools" and select the function "Choose Toolbox items": A dialog appears. As ActiveBarcode is a COM component first select the tab "COM Components": A list of the available controls will be displayed. Select "ActiveBarcode" and activate it. Then click OK. Visual C# and C++ Barcodes in projects 13
Now ActiveBarcode is added to your development environment. Use ActiveBarcode (A simple example) Create a new project. To add the ActiveBarcode Control to a form you select the function "Toolbox" from the "View" menu first. This opens the toolbox. "Toolbox": Have a look for the ActiveBarcode Control in the toolbox now. Visual C# and C++ Barcodes in projects 14
Click on ActiveBarcode there and place it into the form. The control will then be integrated on this form. You can change the barcode properties of the barcode control now or later. In this example we change the background color to white: Visual C# and C++ Barcodes in projects 15
Now add a "Textbox" to this form, too. Double click this textbox now to open the source code for the event "Textchange". We will use this event to change the barcodes content every time the textbox changes. Visual C# and C++ Barcodes in projects 16
That's it. Now launch this example application: If you change the content of the textbox in the running application, the barcode will encode this. Not visual usage of ActiveBarcode: You also can create ActiveBarcode at run time and use the the control: In the following example ActiveBarcode is created invisible, then a EAN 13 code with the encoded content "123456789012" is generated and saved as image file by using the SaveAsBySize function. BARCODELib.Barcode ab = new BARCODELib.Barcode(); ab.text = "123456789012"; ab.typename = "EAN 13"; ab.saveasbysize("example.bmp", 400, 150); If you have no reference to ActiveBarcode in your application, go to the Solution Explorer and click with the right mouse button on "References", then select "Add Reference > COM > ActiveBarcode". Visual C# and C++ Barcodes in projects 17
More examples: // Copy the barcode into the clipboard. ab.copytoclipboardbysize(400, 150); // Display the about box. ab.aboutbox(); This manual was created by Frank Horn Visual C# and C++ Barcodes in projects 18
Delphi 2005 XE2 Barcodes in projects To use this functionality you require the Enterprise Edition How to use barcodes in Delphi You can use ActiveBarcode in Delphi like any other control (e.g. like a button). First you have to add the ActiveBarcode control into the Delphi development environment. Add ActiveBarcode to the Delphi development environment (The is also a description for older Delphi versions (4 7) available) Select a package in which you would like to take up the Control or create a new package ("File" "New" "Package Delphi for Win32 "): Save this package under an own name with the "Save as" function. For example as "ActiveBarcodePackage". Now import the ActiveBarcode Control in the package. Launch the function "Component import" from the menu "Component". The "Component dialog" appears: Delphi 2005 XE2 Barcodes in projects 19
Select "ActiveX control" and click "Continue". Now a list of the available controls will be shown: Select "ActiveBarcode" from that list and click "Continue". A page for component setup will be shown: You don't need to change something here. Click "Continue". A page for "Install" appears. Select "Add unit to the project.." here and click on "Finish". Now ActiveBarcode is added as a component to the package. Now you must compile the package. Select the function " ActiveBarcodePackage create" from the menu "Project": Delphi 2005 XE2 Barcodes in projects 20
Use ActiveBarcode (Example) Create a new project: "File" "New" "Form application VCL". To place ActiveBarcode now onto a form you select the ActiveBarcode Control from the tool palette. You'll find this under "ActiveX" as a "TBarcode" component: Select TBarcode and place the component on the form. In the object inspector you can customize the properties of the component. E.g. set the background color on white. For this example add one more TEdit to the form. Now you form might look as follows: Delphi 2005 XE2 Barcodes in projects 21
Now we "link" the edit field directly with the control. Open the source code for the "textchange" event by double clicking the edit field. This event always is called, if the contents of the edit field are changed. Ideally for our example. We give this update immediately to the control. That's it. Now launch the program: Change the content of the edit field to change the barcode. Programming: Setting properties is very simple. Some examples: Barcode1.Text := '123456789012'; Barcode1.BackColor := clwhite; Barcode1.ForeColor := clblack; Using the Picture Property: Copy the barcode to a image object: Delphi 2005 XE2 Barcodes in projects 22
Image1.Picture.Bitmap.Height := Barcode1.Height; Image1.Picture.Bitmap.Width := Barcode1.Width; Barcode1.Picture.PictureAdapter := nil; // delphi workaround Image1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic); Clipboard: Copy the current barcode to the clipboard. Metafile (WMF): Barcode1.CopyToClipboard; Bitmap: Image1.Picture.Bitmap.Height := Barcode1.Height; Image1.Picture.Bitmap.Width := Barcode1.Width; Barcode1.Picture.PictureAdapter := nil; // delphi workaround Image1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic); Clipboard.Assign(Image1.Picture.Bitmap); This manual was created by Frank Horn Delphi 2005 XE2 Barcodes in projects 23
Delphi 4 7 Barcodes in projects To use this functionality you require the Enterprise Edition How to use barcodes in Delphi (Version 4.x to 7.x) You can use ActiveBarcode in Delphi like any other control (e.g. like a button). First you have to add the ActiveBarcode control into the Delphi development environment. Go to the menu "Component" and select the function "Import ActiveX control": A dialog shows up on your screen. Select "ActiveBarcode" from that list of controls. Then click the "Install..." button: Delphi 4 7 Barcodes in projects 24
Follow the instructions showing on your screen. Now the ActiveBarcode control is added to your Delphi development environment. The barcode icons of ActiveBarcode will appear in the tool bar located in "ActiveX": Now select this icon and place it anywhere in a form. The barcode control will be placed in that form. This will be a standard barcode. You can change this and all other properties of that barcode control in the "Object Inspector". Delphi 4 7 Barcodes in projects 25
For example you can select any barcode that is supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. Programming: To set the properties is very simple. Some examples: Barcode1.Text := '123456789012'; Barcode1.BackColor := clwhite; Barcode1.ForeColor := clblack; Using the Picture Property: How to copy the barcode image into a image object: Image1.Picture.Bitmap.Height := Barcode1.Height; Image1.Picture.Bitmap.Width := Barcode1.Width; Barcode1.Picture.PictureAdapter := nil; // delphi workaround Image1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic); Clipboard: How to copy a barcode into the Windows clipboard. First as meta file (WMF): Barcode1.CopyToClipboard; And now as bitmap image: Image1.Picture.Bitmap.Height := Barcode1.Height; Image1.Picture.Bitmap.Width := Barcode1.Width; Barcode1.Picture.PictureAdapter := nil; // delphi workaround Image1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic); Clipboard.Assign(Image1.Picture.Bitmap); Delphi 4 7 Barcodes in projects 26
This manual was created by Frank Horn Delphi 4 7 Barcodes in projects 27
VisualBasicScript Barcodes in projects ActiveBarcode in VisualBasicScript (Windows Scritping Host) You can use ActiveBarcode with VisualBasic Script (VBS, Windows Scripting Host) to create barcodes in scripts automatically. Here we show you how simple is it to use ActiveBarcode in VBS. First make the ActiveBarcode control available in your script: Dim barcode Set barcode = WScript.CreateObject("BARCODE.BarcodeCtrl.1") Now you can use the variable 'barcode' to access the control. Use the Properties of the control to create the barcode you want: barcode.typename = "Code128" barcode.text = "123456789012" Then use the 'SaveAs' method to save the barcode as an image file: barcode.saveas("examplebarcode.png") To learn more about this, please have a look at the VisualBasic Script application 'barcodeimage.wsf' that is included in the ActiveBarcode package. You can use this source code for learning purposes or use it as a start for your own scripts. This manual was created by Frank Horn VisualBasicScript Barcodes in projects 28
JavaScript Barcodes in projects How to use the barcode control with JavaScript (Windows) You can create the ActiveBarcode Control with Java script (e.g., with the Internet Explorer) at run time and use is non visual: // Create the control: ab = new ActiveXObject("BARCODE.BarcodeCtrl.1"); // Set the barcode type and content: ab.text = "Example"; ab.typename = "Code 128"; // Save the barcode as image file: ab.saveasbysize("example.bmp", 400, 100); // Example: Show the controls about box: ab.aboutbox(); This manual was created by Frank Horn JavaScript Barcodes in projects 29
Lotus Domino, LotusScript Barcodes in projects Using the barcode control in a LotusScript agent This is a script example to run under IBM's Lotus Domino as a LotusScript agent: Option Public Option Declare Sub Initialize() Dim MyObject As variant Set MyObject = CreateObject("BARCODE.BarcodeCtrl.1") MyObject.text = "Example" MyObject.typename = "Code 128" MyObject.SaveAsBySize "c:\example.bmp", 400, 100 End Sub Lotus Domino, LotusScript Barcodes in projects 30
Access 2010 Barcodes in reports To use this functionality you require the Enterprise Edition Barcodes in an Access 2010 database report Here we show you how to add a barcode into a Access database report and bind it to a data field. First launch Access and create a new database or open an already existing database in what you want to add a barcode. A simple database could look like this: Next create a new report. Now add the ActiveBarcode control to the report. You must be in "Design Mode" to do this. Select the "Design" tab. Click on the button "Insert ActiveX control" from the range of "Controls". Access 2010 Barcodes in reports 31
A dialog will show up: Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your report. This will be a standard barcode of EAN 128 type. This is the default type. Now you can modify this barcode. You can change the type, text, colors etc. For this click inside the barcode with the right mouse button. A pop up menu will open. Access 2010 Barcodes in reports 32
Select "ActiveBarcode Object" and then "Properties...". The property dialog of ActiveBarcode will open. Here you can modify the barcode as you like. For example you can change the type to any barcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. Now place and resize the barcode element for your needs. Next we bind the controls text property (the barcodes content) to the data field "Code" of the database. Select the "Design" tab. Click on the button "Property sheet" from the range of "Tools". Have a look for the entry "Control Source" and change it to "Code". This is the data binding: Now close the design mode and switch to report view: Access 2010 Barcodes in reports 33
Watch the result: The barcode control is bound to the data base field and shows the code of the current data set as EAN 128 barcode. One last hint: A report is designed in a lower resolution that it is using while printing. So it may be required that you create the barcode control with a much bigger font size than you would normally use. Otherwise the text line under the barcode may be very very small in your print. This manual was created by Frank Horn Access 2010 Barcodes in reports 34
Access 2010 Barcodes in reports 35
Access 2010 Barcodes in Forms To use this functionality you require the Enterprise Edition Barcodes in an Access 2010 database formular Here we show you how to add a barcode into a Access database and bind it to a data field. First launch Access and create a new database or open an already existing database in what you want to add a barcode. A simple database could look like this: Next create a new form. This is easy and we do not explain this functionality of Access further. If you have questions about this, please have a look into the Access Online Help Now add the ActiveBarcode control to the form. You must be in "Design Mode" to do this. Select the "Developer tab". Click on the button "Insert ActiveX control" from the range of "Controls". Access 2010 Barcodes in Forms 36
A dialog will appear. Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your form. This will be a standard barcode of EAN 128 type. This is the default type. Now you can modify this barcode. You can change the type, text, colors etc. For this click inside the barcode with the right mouse button. A pop up menu will open. Select "ActiveBarcode Object" and then "Properties...". The property dialog of ActiveBarcode will open. Here you can modify the barcode as you like. For example you can change the type to any barcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. Next we bind the controls text property (the barcodes content) to the data field "Productnumber" of the database. Select the "Developer tab". Click on the button "Property page" from the range of "Tools". Access 2010 Barcodes in Forms 37
Have a look for the entry "Control Source" and change it to "Productnumber". This is the data binding: Now close the design mode of the form and watch the result by simple opening the form: The barcode control is bound to the data base field and shows the product number of the current data set as EAN 128 barcode. Embedding and binding an ActiveBarcode control into reports is very similar. Access 2010 Barcodes in Forms 38
One last hint: A report is designed in a lower resolution that it is using while printing. So it is required that you create the barcode control with a much bigger font size than you would normally use. Otherwise the text line under the barcode may be very very small in your print. This manual was created by Frank Horn Access 2010 Barcodes in Forms 39
Access 2007 Barcodes in reports To use this functionality you require the Enterprise Edition Barcodes in an Access 2007 database report Here we show you how to add a barcode into a Access database report and bind it to a data field. First launch Access and create a new database or open an already existing database in what you want to add a barcode. A simple database could look like this: Next create a new report. Now add the ActiveBarcode control to the report. You must be in "Design Mode" to do this. Select the "Design" tab. Click on the button "Insert ActiveX control" from the range of "Controls". Access 2007 Barcodes in reports 40
A dialog will show up: Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your report. This will be a standard barcode of EAN 128 type. This is the default type. Now you can modify this barcode. You can change the type, text, colors etc. For this click inside the barcode with the right mouse button. A pop up menu will open. Access 2007 Barcodes in reports 41
Select "ActiveBarcode Object" and then "Properties...". The property dialog of ActiveBarcode will open. Here you can modify the barcode as you like. For example you can change the type to any barcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. Now place and resize the barcode element for your needs. Next we bind the controls text property (the barcodes content) to the data field "Code" of the database. Select the "Design" tab. Click on the button "Property sheet" from the range of "Tools". Have a look for the entry "Control Source" and change it to "Code". This is the data binding: Access 2007 Barcodes in reports 42
Now close the design mode and switch to report view: Watch the result: The barcode control is bound to the data base field and shows the code of the current data set as EAN 128 barcode. One last hint: A report is designed in a lower resolution that it is using while printing. So it may Access 2007 Barcodes in reports 43
be required that you create the barcode control with a much bigger font size than you would normally use. Otherwise the text line under the barcode may be very very small in your print. This manual was created by Frank Horn Access 2007 Barcodes in reports 44
Access 2007 Barcodes in Forms To use this functionality you require the Enterprise Edition Barcodes in an Access 2007 database formular Here we show you how to add a barcode into a Access database and bind it to a data field. First launch Access and create a new database or open an already existing database in what you want to add a barcode. A simple database could look like this: Next create a new form. This is easy and we do not explain this functionality of Access further. If you have questions about this, please have a look into the Access Online Help Now add the ActiveBarcode control to the form. You must be in "Design Mode" to do this. Select the "Developer tab". Click on the button "Insert ActiveX control" from the range of "Controls". The following dialog will appear: Access 2007 Barcodes in Forms 45
Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your form. This will be a standard barcode of EAN 128 type. This is the default type. Now you can modify this barcode. You can change the type, text, colors etc. For this click inside the barcode with the right mouse button. A pop up menu will open. Select "ActiveBarcode Object" and then "Properties...". The property dialog of ActiveBarcode will open. Here you can modify the barcode as you like. For example you can change the type to any barcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. Next we bind the controls text property (the barcodes content) to the data field "Productnumber" of the database. Select the "Developer tab". Click on the button "Property sheet" from the range of "Tools". Have a look for the entry "Control Source" and change it to "Productnumber". This is the data binding: Access 2007 Barcodes in Forms 46
Now close the design mode of the form and watch the result by simple opening the form: The barcode control is bound to the data base field and shows the product number of the current data set as EAN 128 barcode. Embedding and binding an ActiveBarcode control into reports is very similar. One last hint: A report is designed in a lower resolution that it is using while printing. So it is required that you create the barcode control with a much bigger font size than you would normally use. Otherwise the text line under the barcode may be very very small in your print. This manual was created by Frank Horn Access 2007 Barcodes in Forms 47
Access 2000, XP, 2003 Barcodes in reports To use this functionality you require the Enterprise Edition Barcodes in an Access 2000, XP, 2003 database report Here we show you how to add a barcode into a Access database report and bind it to a data field. First launch Access and create a new database or open an already existing database in what you want to add a barcode. A simple database could look like this: Next create a new report. Now add the ActiveBarcode control to the report. You must be in "Design Mode" to do this. Go to the menu "Insert" and select "ActiveX control": A dialog will show up: Access 2000, XP, 2003 Barcodes in reports 48
Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your report. This will be a standard barcode of EAN 128 type. This is the default type. Now you can modify this barcode. You can change the type, text, colors etc. For this click inside the barcode with the right mouse button. A pop up menu will open. Select "ActiveBarcode Object" and then "Properties...". The property dialog of ActiveBarcode will open. Here you can modify the barcode as you like. For example you can change the type to any barcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. Now place and resize the barcode element for your needs. Access 2000, XP, 2003 Barcodes in reports 49
Next we bind the controls text property (the barcodes content) to the data field "Code" of the database. Go to the menu "View" and select "Properties": Have a look for the entry "Control Source" and change it to "Code". This is the data binding: Now close the design mode, switch to report view and watch the result: The barcode control is bound to the data base field and shows the code of the current data set as EAN 128 barcode. One last hint: A report is designed in a lower resolution that it is using while printing. So it may Access 2000, XP, 2003 Barcodes in reports 50
be required that you create the barcode control with a much bigger font size than you would normally use. Otherwise the text line under the barcode may be very very small in your print. This manual was created by Frank Horn Access 2000, XP, 2003 Barcodes in reports 51
Access 2000, XP, 2003 Barcodes in forms To use this functionality you require the Enterprise Edition Barcodes in an Access 2000, XP, 2003 database, formular or report Here we show you how to add a barcode into a Access database and bind it to a data field. First launch Access and create a new database or open an already existing database in what you want to add a barcode. A simple database could look like this: Fill the database with some data using the table. See this example: Next create a new form. This is easy and we do not explain this functionality of Access further. If you have questions about this, please have a look into the Access Online Help Now add the ActiveBarcode control to the form. Goto to the menu and select from the the menu "Insert" the function "ActiveX Control...". Access 2000, XP, 2003 Barcodes in forms 52
The following dialog will appear: Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your form. This will be a standard barcode of EAN 128 type. This is the default type. Now you can modify this barcode. You can change the type, text, colors etc. For this click inside the barcode with the right mouse button. A pop up menu will open: Select "ActiveBarcode Object" and then "Properties...". The property dialog of ActiveBarcode will open. Here you can modify the barcode as you like. For example you can change the type to Access 2000, XP, 2003 Barcodes in forms 53
any barcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code 128, Data Matrix, EAN 8, EAN 13, EAN 18, EAN 128, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, Bookland, ITF 14, PDF417, QR Code, SCC 14, SSCC 18, UCC 128, UPC A, UPC E. In this example we use the EAN 128, so there is no need to change the type now. Next we bind the controls text property (the barcodes content) to the data field "Productnumber" of the database. Again click the barcode with the right mouse button and select "Properties": Have a look for the entry "Control Source" and change it to "Productnumber". This is the data binding: Now close the design mode of the form and watch the result by simple opening the form: Access 2000, XP, 2003 Barcodes in forms 54
The barcode control is bound to the data base field and shows the product number of the current data set as EAN 128 barcode. Embedding and binding an ActiveBarcode control into reports is very similar. One last hint: A report is designed in a lower resolution that it is using while printing. So it is required that you create the barcode control with a much bigger font size than you would normally use. Otherwise the text line under the barcode may be very very small in your print. This manual was created by Frank Horn Access 2000, XP, 2003 Barcodes in forms 55
ActiveBarcode Control (OCX) ActiveBarcode Control Embed an ActiveBarcode Object (Control, OCX, ActiveX) into your documents and projects. It's very flexible and can be automated. Create barcode objects directly in your documents. You can edit and automate the barcode directly inside the documents. Developers use ActiveBarcode like a standard control. Place the barcode control onto your application form and get barcode technology with a few clicks! Programmers Reference: Here you have an overview of all properties, methods and events of ActiveBarcode. Please select one of the following chapters to get descriptions on: Properties Methods Events The property dialog Information about distributing the ActiveX control (Enterprise Edition, Developer licence) Fullsize view PDF Download Barcode types: If you want more information of barcode types, go to Codes: Codabar, Code 25 Industrial, Code 25 Interleaved, Code 39, Code 39 Extended, Code 93, Code 93 Extended, Code 128, Data Matrix, DUN 14, EAN 2, EAN 5, EAN 8, EAN 13, EAN 14, EAN 18, EAN 99, EAN 128, EAN Velocity, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, GTIN 14, Identcode, ISBN 10, ISBN 13, ISBN 13 Dual, Bookland, ISSN, ISMN, ITF 14, JAN, Leitcode, MSI, NVE, PDF417, PostNet, PZN7, PZN8, QR Code, Royal Mail SCC 14, SSCC 18, UCC 128, UPC A and UPC E FAQ If you have further questions or problems, please have a look at our FAQ. ActiveBarcode Control (OCX) 56
ActiveBarcode Control (OCX) 57
Property Dialog: General General settings The General page of the property dialog: You can set the following properties here: Text: Here you enter the text to be encoded in the barcode. Demo Text: If you push this button, a valid demo text for the current selected barcode type will be generated automatically. Show Text: If you swith this checkbox on, the human readable line will be created. If it's off, the human readable line will not be shown in the barcode control. Type: Here you can select the barcode type. ActiveBarcode currently supports the following types: Codabar, Code 25 Industrial, Code 25 Interleaved, Code 39, Code 39 Extended, Code 93, Code 93 Extended, Code 128, Data Matrix, DUN 14, EAN 2, EAN 5, EAN 8, EAN 13, EAN 14, EAN 18, EAN 99, EAN 128, EAN Velocity, GS1 128, GS1 Data Matrix, GTIN 8, GTIN 12, GTIN 13, GTIN 14, Identcode, ISBN 10, ISBN 13, ISBN 13 Dual, Bookland, ISSN, ISMN, ITF 14, JAN, Leitcode, MSI, NVE, PDF417, PostNet, PZN7, PZN8, QR Code, Royal Mail SCC 14, SSCC 18, UCC 128, UPC A and UPC E Rotate: You set the orientation/rotation of the barcode in degreess (0,90,180,270). The property dialog: General Fonts Colors Layout Property Dialog: General 58
Property Dialog: General 59
Property Dialog: Fonts Font settings The Fonts page of the property dialog: You can set the following properties here: Font name: Select the font for the human readable line. You always should use TrueType fonts. Otherwise there may be display problems when rotating the barcode. Attributes: Select attributes for your font, e.g. bold, italic, etc. Size: Select the size of the font. Effects: You can use additional effects for the font here. The property dialog: General Fonts Colors Layout Property Dialog: Fonts 60
Property Dialog: Fonts 61
Property Dialog: Colors Color settings The Colors page of the property dialog: You can set the following properties here: Propertyname: Select BackColor or ForeColor here in oeder what you want to edit. System color: Not used here. Color: Select a color. The property dialog: General Fonts Colors Layout Property Dialog: Colors 62
Property Dialog: Layout Layout settings The Layout page of the property dialog: You can set the following properties here: Alignment: Alignment sets the alignment (0=left, 1=center, 2=right) of the barcode inside the control. Borderheight: BorderHeight sets the height of the border above and under the barcode in pixels. The border is painted in the current background color (BackColor). Borderwidth: BorderWidth sets the width of the border on the left and the right of the barcode in pixels. The border is painted in the current background color (BackColor). NotchHeightInPercent: Sets the length of the notches in percent. Printfix: If you have the problem that the bars of the code are too thin when printing (i.e. with Excel), set this property to true. The property dialog: General Fonts Colors Layout Property Dialog: Layout 63
Property Dialog: Layout 64
ActiveBarcode Commandline Tool General You can use the ActiveBarcode command line tool to create barcode images files directly from the command line. E.g. use it in batch or script programs. The commandline tool is included in the ActiveBarcode program package. When you setup ActiveBarcode to your system, the commandline tool also will be installed. You can find the tool named barcodeimage.wsf in the folder you installed ActiveBarcode to. General this is c:\programs\activebarcode. An example: The following call of the tool will create a 400x200 pixels sized PNG image file named ean.png with an EAN 13 barcode encoding "192837465012". barcodeimage ean.png text=192837465012 typename=ean13 width=400 height=200 One more example: The following call of the tool will create a 500x100 pixels sized PNG image file named code128.bmp with an Code 128 barcode encoding "Hello World". barcodeimage code128.bmp "text=hello World" type=14 width=500 height=100 Powershell: If you want to use 'barcodeimage' with the Microsoft Windows PowerShell, you have to call it using 'cscript'. See this example: cscript barcodeimage.wsf code128.bmp "text=hello World" type=14 width=500 height=100 ActiveBarcode Commandline Tool 65
Command line parameters for the console Usage: barcodeimage filename [Parameter] Parameter Description Example text= text to be encoded text=123456789012 type= barcode type type=0 width= width in pixels width=500 height= height in pixels height=500 alignment= Alignment 1=left 2=center 3=right alignment=2 borderwidth= borderwidth in pixels borderwidth=10 borderheight= borderheight in pixels borderheight=1 notchheightinpercent= the notch height in % notchheightinpercent=25 showtext=off no textline under the code showtext=off forecolor= backcolor= sets the foreground color hexadecimal RGB as RRGGBB sets the background color hexadecimal RGB as RRGGBB foreground=000000 (example is black) background=ffffff (example is white) fontname= font for the text line fontname=arial fontsize= font size fontsize=8 fontbold= font bold (on/off) fontbold=on fontitalic= font italic (on/off) fontitalic=on fontunderline= font underline (on/off) fontunderline=on fontstrikeout= font strikeout (on/off) fontstrikeout=on filetype= colordepth= file type of image (valid values: bmp, jpg, png, tif, tga, gif, wbm, pbm, pgm, ppm, xpm, wmf, emf) Default: auto detect by extension of filename colordepth of the image file (valid values: 1,8,16,24,36) filetype=bmp colordepth=24 flags= flags for the image file flags=0x80 angle= transparent= dpi= echo= rotates the image file (valid values: 0 359) background transparency (valid values: 0, 1, not implemented yet) resolution in DPI for jpg, png, tif & bmp files off: display no messages errors: display only errors verbose:display all messages and open barcode in ImageView angle=180 transparent=1 dpi=300 echo=off echo=errors echo=verbose ActiveBarcode Commandline Tool 66
64bit Windows If you want to use the barcodeimage.wsf program under Windows 64bit, you need to run the barcodeimage.wsf in 32 bit, as the control is 32 bit too. On 64bit machines wsf files are running in 64bit mode by default. Have a look for a 32bit version of the cscript.exe or wscript.exe on your machine and then call the script using the following commands: cscript.exe barcodeimage.wsf or wscript.exe barcodeimage.wsf In general the cscript and/or wscript files are located in the %windir%\syswwow64 folder. Example For example you can use the command line tool to create barcodes dynamically in a OpenOffice document. We have created an example file for OpenOffice Calc that creates barcodes from a list of numbers right beside the numbers in a sheet. You can download this example file directly using this link: ab_barcodelist.ods Please have a look at the notes inside this document: You may have to edit the path of the command line tool inside the macro. Example batch file The ActiveBarcode software package contains a batch file to demonstrate the BarcodeImage program. This file has the name BarcodeImage Demo.bat and has been installed by the setup into the ActiveBarcode folder. This batch file generates a demo_barcode_image* file for every image format in every supported color depth. Every possible combination is automatically generated and error messages are displayed on impossible parameter combinations. Please open the batch file before you start it and read the tips contained in it. ActiveBarcode Commandline Tool 67
Barcode types ActiveBarcode supports the following barcode types: ActiveBarcode calculates the check digit where available automatically for you. Code Beispiel Length Character set Description Code 128 variable GS1 128, EAN 128, UCC 128 EAN 13, GTIN 13 variable ASCII (128 chars) ASCII (128 chars) 13 numeric 0 9 Modern 1D type of barcode. Has highly copmpressed data. Very often used. This special form of the Code 128 is used for goods and palettes in commerce and industry. More than one data field can be encoded using Application Identifiers. The EAN code is primarily used in supermarkets to identify products at the point of sales. QR Code variable ASCII 2D barcode for encoding mass text or data in only one code. Often used for Mobile Tagging with cell phones. Data Matrix variable ASCII 2D barcode for encoding mass text or data in only one code. GS1 Data Matrix variable ASCII (128 chars) This special form of the Data Matrix is used for goods and palettes in commerce and industry. More than one data field can be encoded using Application Identifiers. EAN 8, GTIN 8 8 numeric 0 9 This is the short version of EAN 13 for extremly small products. PDF417 variable ASCII 2D barcode for encoding mass text or data in only one code. ISBN 13 13 numeric 0 9 ISSN 8 numeric 0 9 ISMN 10 numeric 0 9 International Standard Book Number. ISBN standard type since 01. January 2007. International Standard Serial Number. The ISSN serves the short unmistakeable identification of sequentially appearing publications, e.g., magazines. The ISMN (Internationally Standard Music Number) is used for marking printed musical publications. Barcode types 68
EAN 14, GTIN 14 14 numeric 0 9 The EAN 14 code is used for traded goods DUN 14 14 numeric 0 9 Distribution Unit Number. Also have a look at EAN 14 and ITF 14. SCC 14 14 numeric 0 9 ITF 14 14 numeric 0 9 EAN 18/NVE 18 numeric 0 9 SSCC 18 18 numeric 0 9 UPC A, GTIN 12 12 numeric 0 9 UPC E 8 numeric 0 9 Shipping Container Symbol. Also have a look at EAN 14 and ITF 14. The ITF 14 barcode is used to create the Shipping Container Symbol. This code is used to mark cartons and palettes that are including goods with an EAN 13 code. The EAN 18/NVE is used to display the Nummer der Versandeinheit (NVE). Serial Shipping Container Code. It is used throughout the supply chain as an identifier for item tracing and internal control. The UPC A code is the standard version of the UPC code and has 12 digits. It is also called UPC 12 and is very similar to the EAN code. This is the short version of UPC A for extremly small products. Code 39 variable A Z, 0 9, 5 special chars Also known as Code 3 of 9. Often used type that is self checking. Code 39 Extended variable ASCII (127 chars) Also known as Code 3 of 9 Extended. Extension of Code 39. Code 25 variable numeric 0 9 Also known as Code 2 of 5 and Code 25 Industrial. Rather old code for industrial use. Code 25 Interleaved variable numeric 0 9 Also known as Code 2 of 5 Interleaved. Industrial use. JAN 13 numeric 0 9 Japanese Article Numbering. It's primarily used in supermarkets to identify product at the point of sales. Barcode types 69
EAN 5 5 numeric 0 9 AddOn code. For example for books (see ISBN). EAN 2 2 numeric 0 9 EAN 99 13 numeric 0 9 EAN Velocity 8 numeric 0 9 ISBN 13 Dual 13 numeric 0 9 ISBN 10 13 numeric 0 9 AddOn code. For example for magazines. "EAN 99 is a special form of the EAN 13, which just starts with ""99"". EAN 99 is used as an in store coupon." EAN Velocity is a special form of the EAN 8. This code is internally used by dealers for products that have no EAN 13 or EAN 8 code from the producer. International Standard Book Number. ISBN transitional type from 01. January 2006 to 31. December 2006. International Standard Book Number. ISBN standard type until 31. December 2005. Codabar variable 0 9, 6 special characters Old barcode type. Often used in medicine in the past. Code 93 variable A Z, 0 9, 5 special chars Same characterset as Code 39 but more compacted code that requires less space. Code 93 Extended variable ASCII (127 chars) Same characterset as Code 39 Extended but more compacted code that requires less space. PZN7 7 numeric 0 9 Pharmazentralnummer für medicine. Special form of Code 39. PZN8 7 numeric 0 9 Pharmazentralnummer für medicine. Special form of Code 39. Leitcode 14 numeric 0 9 The Leitcode is used by Deutschen Post/DHL. Identcode 12 numeric 0 9 The Identcode is used by Deutschen Post/DHL. Barcode types 70
Code 128A variable Uppercase letters and control characters Subcode of Code 128. This type is normally not used for itself. Use Code 128 or EAN 128 instead. Code 128B variable Upper and lowercase letters Subcode of Code 128. This type is normally not used for itself. Use Code 128 or EAN 128 instead. Code 128C variable numeric 0 9 Subcode of Code 128. This type is normally not used for itself. Use Code 128 or EAN 128 instead. MSI Plessey variable numeric 0 9 Old code typ. Was used for goods and books in the past. PostNet Royal Mail variable numeric 0 9 variable A Z, 0 9 This code us used to improve the speed of sorting and delivering of mail. The Royal Mail 4 State Customer Code (RM4SCC) was created for automated mail sortation processes. (*) This type number is the number of the barcode of the control's property Type. Barcode types 71
OCX: Properties Properties of des Controls Name Type Description read only Text ShowText char bool Text contains the content of the barcode. General without check digit. TRUE: The barcode has a human readable text. (default) FALSE: The barcode is displayed without the text. Type long Specifies the barcode type. Rotate Alignment long AlignConstants Rotate contains the orientation of the displayed barcode in degreess (0,90,180,270). Alignment sets the alignment (on the left, on the right, centered) of the barcode. You can pass AlignLeft, AlignCenter or AlignRight. TypeName char Contains the name of the barcode type. IsValid IsSizeOk bool bool Returns TRUE if the barcode is valid. If it's invalid, the text cannot be coded with the selected barcode type. Returns TRUE if the barcode is displayed correct. If it's FALSE, the barcode cannot be displayed because the controls dimensions are too small to display the barcode correct. read only read only Checksum long Returns the check digit. read only Picture pictureobject Returns the barcode picture. read only BackColor OLE_Color Background color of the barcode. ForeColor OLE_Color Foreground color of the barcode. Font fontobject Specifies the font by name, style, effects and the size for the text line. Version char Returns the controls version number. read only BorderHeight BorderWidth MaxBorderHeight MaxBorderWidth long long long long BorderHeight sets the height of the border above and under the barcode in pixels. The border is painted in the current background color (BackColor). BorderWidth sets the width of the border on the left and the right of the barcode in pixels. The border is painted in the current background color (BackColor). MaxBorderHeight returns the maximum possible value of BorderHeight. MaxBorderWidth returns the maximum possible value of BorderWidth. NotchHeightInPercent long Sets the length of the notches in percent. PrintFix bool If you have the problem that the bars of the code are too thin when printing (i.e. with read only read only OCX: Properties 72
Excel), set this property to true. AutoType bool This property should not be used. It's only implemented for compatibility purposes to old versions. ActiveBarcde tries to detect the barcode type automatically. OCX: Properties 73
OCX: Methods Methods of the Control Name Parameter Description CopyToClipboard CopyToClipboardBySize CreatePictureBySize SaveAs SaveAsBySize SaveAsBySizeExtended SetDemoText BinaryWriteAsPNGBySize : bool (Width: Integer, Height: Integer): Bool (Width: Integer, Height: Integer): Bool (path: WideString): Smallint (path: WideString, Width: Integer, Height: Integer): Smallint (path: WideString, Width: Integer, Height: Integer, Format: Integer, ColorDepth: Integer, Transparent: Integer, Flags: Integer, Angle: Integer, DPI: Integer): Smallint (Width: Integer, Height: Integer): OleVariant Copies the barcode in meta graphic format to the clipboard. Returns TRUE if successful. Copies the barcode in meta graphic format to the clipboard. The size of the barcode is specified by the arguments width and height. Returns TRUE if successful. Allows a custom sized Picture property to be handled. The size of the barcode picture is specified by the arguments width and height. Returns TRUE if successful. Saves the current barcode as image file (BMP, JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP and XPM). The image size is the current size of the control. The image file type used is defined by the extension of the file name (e.g. BMP for a Windows Bitmap). Saves the current barcode as image file (BMP, JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP and XPM). The image size is specified by the parameters width and height. The image file type used is defined by the extension of the file name (e.g. BMP for a Windows Bitmap). Extended version of the SaveAsBySize Method. Sets the property Text to a valid default value. Use this for demonstration or test purposes to get a valid code. Returns the current barcode in binary PNG image format. The size is specified by Width and Height parameters. This method is only available in the Enterprise Edition. BinaryWriteAsPNG : OleVariant Returns the current barcode in current size binary PNG image format. This method is only available in the OCX: Methods 74
AboutBox SaveAsPNG SaveAsPNGBySize (path: WideString): Smallint (path: WideString, Width: Integer, Height: Integer): Smallint Enterprise Edition. Opens the info dialog of ActiveBarcode and shows Version and other details. Saves the current barcode as PNG image file. The image size is the current size of the control. Saves the current barcode as PNG image file. The image size is specified by the paramters width and height. OCX: Methods 75
OCX: Events Events of the Control Name Parameter Description TypeChange TextChange BarcodeType:long Text:char ShowTextChange ShowText:bool AutoTypeChange PrintFixChange AutoType:bool PrintFix:bool Is triggered when the barcode type is changed. The property Type is passed and can be used. Is triggered when the barcode text is changed. The property Text is passed and can be used. Is triggered when the display of the barcode text enabled or disabled. The property ShowText is passed and can be used. Is triggered when the Autotype option is enabled or disabled. The property Autotype is passed and can be used. Is triggered when the PrintFix option is enabled or disabled. The property PrintFix is passed and can be used. OCX: Events 76
Property: Text Text char Text contains the content of the barcode. General without check digit. Property: Text 77
Property: ShowText ShowText bool TRUE: The barcode has a human readable text. (default) FALSE: The barcode is displayed without the text. Examples: ShowText=TRUE ShowText=FALSE Property: ShowText 78
Property: Type Type long Specifies the barcode type. value long Code Name 0 ISBN 10 CODEISBN 1 (default) EAN 13 CODEEAN13 2 EAN 8 CODEEAN8 3 EAN 5 CODEEAN5 4 EAN 2 CODEEAN2 5 UPC A CODEUPCA 6 Code 39 CODE39 7 Code 25 Interleaved CODE25I 8 Codabar CODABAR 9 10 Code 25 Industrial Code 39 Extended CODE25 CODE39E 11 Code 128A CODECODE128A 12 Code 128B CODECODE128B 13 Code 128C CODECODE128C 14 Code 128 CODECODE128 15 EAN/UCC 128 CODEEAN128 16 EAN 99 CODEEAN99 17 UPC E CODEUPCE 18 PostNet CODEPOSTNET 19 Royal Mail CODEROYALMAIL 20 MSI CODEMSI 21 Code 93 CODE93 22 Code 93 Extended CODE93E 23 PZN7 CODEPZN8 24 Identcode CODEINDENTCODE 25 Leitcode CODELEITCODE 26 27 Code 39 Checksum Code 39 Extended Checksum CODE39CHECKSUM CODE39ECHECKSUM 28 EAN/UCC 128 AI CODEEAN128AI 29 EAN 14 CODEEAN14 30 ITF 14 CODEITF14 31 EAN 18/NVE CODEEAN18 Property: Type 79
32 SSCC 18 CODESSCC18 33 34 35 Codabar Checksum Code 25 Interleaved Checksum Code 25 Industrial Checksum CODABARCHECKSUM CODE25ICHECKSUM CODE25CHECKSUM 36 PDF417 CODEPDF417 37 DataMatrix CODEDATAMATRIX 38 ISBN 13 CODEISBN13 39 ISBN 13 Dual CODEISBN13DUAL 40 ISSN CODEISSN 41 ISMN CODEISMN 42 43 44 45 DataMatrix Square DataMatrix Rectangular DataMatrix 10x10 DataMatrix 12x12 CODEDATAMATRIXSQUARE CODEDATAMATRIXRECTANGULAR CODEDATAMATRIX10X10 CODEDATAMATRIX12X12 46 DataMatrix 8x18 CODEDATAMATRIX8X18 47 DataMatrix 14x14 CODEDATAMATRIX14X14 48 DataMatrix 8x32 CODEDATAMATRIX8X32 49 50 51 52 53 54 55 56 57 58 59 DataMatrix 16x16 DataMatrix 12x26 DataMatrix 18x18 DataMatrix 20x20 DataMatrix 12x36 DataMatrix 22x22 DataMatrix 16x36 DataMatrix 24x24 DataMatrix 26x26 DataMatrix 16x48 DataMatrix 32x32 CODEDATAMATRIX16X16 CODEDATAMATRIX12X26 CODEDATAMATRIX18X18 CODEDATAMATRIX20X20 CODEDATAMATRIX12X36 CODEDATAMATRIX22X22 CODEDATAMATRIX16X36 CODEDATAMATRIX24X24 CODEDATAMATRIX26X26 CODEDATAMATRIX16X48 CODEDATAMATRIX32X32 Property: Type 80
60 61 62 63 64 65 66 67 68 69 70 71 72 73 DataMatrix 36x36 DataMatrix 40x40 DataMatrix 44x44 DataMatrix 48x48 DataMatrix 52x52 DataMatrix 64x64 DataMatrix 72x72 DataMatrix 80x80 DataMatrix 88x88 DataMatrix 96x96 DataMatrix 104x104 DataMatrix 120x120 DataMatrix 132x132 DataMatrix 144x144 CODEDATAMATRIX36X36 CODEDATAMATRIX40X40 CODEDATAMATRIX44X44 CODEDATAMATRIX48X48 CODEDATAMATRIX52X52 CODEDATAMATRIX64X64 CODEDATAMATRIX72X72 CODEDATAMATRIX80X80 CODEDATAMATRIX88X88 CODEDATAMATRIX96X96 CODEDATAMATRIX104X104 CODEDATAMATRIX120X120 CODEDATAMATRIX132X132 CODEDATAMATRIX144X144 74 GS1 Data Matrix CODEGS1DATAMATRIX 75 76 77 78 79 80 81 82 83 84 GS1 Data Matrix Square GS1 Data Matrix Rectangular GS1 Data Matrix 10x10 GS1 Data Matrix 12x12 GS1 Data Matrix 8x18 GS1 Data Matrix 14x14 GS1 Data Matrix 8x32 GS1 Data Matrix 16x16 GS1 Data Matrix 12x26 GS1 Data Matrix 18x18 CODEGS1DATAMATRIXSQUARE CODEGS1DATAMATRIXRECTANGULAR CODEGS1DATAMATRIX10X10 CODEGS1DATAMATRIX12X12 CODEGS1DATAMATRIX8X18 CODEGS1DATAMATRIX14X14 CODEGS1DATAMATRIX8X32 CODEGS1DATAMATRIX16X16 CODEGS1DATAMATRIX12X26 CODEGS1DATAMATRIX18X18 85 CODEGS1DATAMATRIX20X20 Property: Type 81
86 87 88 89 90 91 92 93 94 95 96 97 98 GS1 Data Matrix 20x20 GS1 Data Matrix 12x36 GS1 Data Matrix 22x22 GS1 Data Matrix 16x36 GS1 Data Matrix 24x24 GS1 Data Matrix 26x26 GS1 Data Matrix 16x48 GS1 Data Matrix 32x32 GS1 Data Matrix 36x36 GS1 Data Matrix 40x40 GS1 Data Matrix 44x44 GS1 Data Matrix 48x48 GS1 Data Matrix 52x52 GS1 Data Matrix 64x64 99 None CODENONE 100 101 102 103 104 105 106 107 GS1 Data Matrix 72x72 GS1 Data Matrix 80x80 GS1 Data Matrix 88x88 GS1 Data Matrix 96x96 GS1 Data Matrix 104x104 GS1 Data Matrix 120x120 GS1 Data Matrix 132x132 GS1 Data Matrix 144x144 108 GS 128 CODEGS1128 109 GTIN 8 CODEGTIN8 110 GTIN 12 CODEGTIN12 111 GTIN 13 CODEGTIN13 112 GTIN 14 CODEGTIN14 CODEGS1DATAMATRIX12X36 CODEGS1DATAMATRIX22X22 CODEGS1DATAMATRIX16X36 CODEGS1DATAMATRIX24X24 CODEGS1DATAMATRIX26X26 CODEGS1DATAMATRIX16X48 CODEGS1DATAMATRIX32X32 CODEGS1DATAMATRIX36X36 CODEGS1DATAMATRIX40X40 CODEGS1DATAMATRIX44X44 CODEGS1DATAMATRIX48X48 CODEGS1DATAMATRIX52X52 CODEGS1DATAMATRIX64X64 CODEGS1DATAMATRIX72X72 CODEGS1DATAMATRIX80X80 CODEGS1DATAMATRIX88X88 CODEGS1DATAMATRIX96X96 CODEGS1DATAMATRIX104X104 CODEGS1DATAMATRIX120X120 CODEGS1DATAMATRIX132X132 CODEGS1DATAMATRIX144X144 Property: Type 82
113 QR Code CODEQRCODE 114 115 116 117 QR Code ECC Level L QR Code ECC Level M QR Code ECC Level Q QR Code ECC Level H CODEQRCODEECCLEVELL CODEQRCODEECCLEVELM CODEQRCODEECCLEVELQ CODEQRCODEECCLEVELH 118 QR Code 21x21 CODEQRCODE21X21 119 QR Code 25x25 CODEQRCODE25X25 120 QR Code 29x29 CODEQRCODE29X29 121 QR Code 33x33 CODEQRCODE33X33 122 QR Code 37x37 CODEQRCODE37X37 123 QR Code 41x41 CODEQRCODE41X41 124 QR Code 45x45 CODEQRCODE45X45 125 QR Code 49x49 CODEQRCODE49X49 126 QR Code 53x53 CODEQRCODE53X53 127 QR Code 57x57 CODEQRCODE57X57 128 QR Code 61x61 CODEQRCODE61X61 129 QR Code 65x65 CODEQRCODE65X65 130 QR Code 69x69 CODEQRCODE69X69 131 QR Code 73x73 CODEQRCODE73X73 132 QR Code 77x77 CODEQRCODE77X77 133 QR Code 81x81 CODEQRCODE81X81 134 QR Code 85x85 CODEQRCODE85X85 135 QR Code 89x89 CODEQRCODE89X89 136 QR Code 93x93 CODEQRCODE93X93 137 QR Code 97x97 CODEQRCODE97X97 138 139 140 141 142 143 144 145 146 QR Code 101x101 QR Code 105x105 QR Code 109x109 QR Code 113x113 QR Code 117x117 QR Code 121x121 QR Code 125x125 QR Code 129x129 QR Code 133x133 CODEQRCODE101X101 CODEQRCODE105X105 CODEQRCODE109X109 CODEQRCODE113X113 CODEQRCODE117X117 CODEQRCODE121X121 CODEQRCODE125X125 CODEQRCODE129X129 CODEQRCODE133X133 147 CODEQRCODE137X137 Property: Type 83
148 149 150 151 152 153 154 155 156 157 QR Code 137x137 QR Code 141x141 QR Code 145x145 QR Code 149x149 QR Code 153x153 QR Code 157x157 QR Code 161x161 QR Code 165x165 QR Code 169x169 QR Code 173x173 QR Code 177x177 158 PZN8 CODEPZN8 CODEQRCODE141X141 CODEQRCODE145X145 CODEQRCODE149X149 CODEQRCODE153X153 CODEQRCODE157X157 CODEQRCODE161X161 CODEQRCODE165X165 CODEQRCODE169X169 CODEQRCODE173X173 CODEQRCODE177X177 Property: Type 84
Property: Rotate Rotate long Rotate contains the orientation of the displayed barcode in degreess (0,90,180,270). Examples: 0 degrees 90 degrees 180 degrees 270 degrees Property: Rotate 85
Property: Alignment Alignment AlignConstants Alignment sets the alignment (on the left, on the right, centered) of the barcode. You can pass AlignLeft, AlignCenter or AlignRight. Beispiele: AlignLeft AlignCenter AlignRight Declaration of 'AlignConstants': type AlignConstants = TOleEnum; const ALIGNLEFT = $00000000; ALIGNCENTER = $00000001; ALIGNRIGHT = $00000002; Property: Alignment 86
Property: TypeName TypeName char Contains the name of the barcode type. Property: TypeName 87
Property: IsValid IsValid bool read only Returns TRUE if the barcode is valid. If it's invalid, the text cannot be coded with the selected barcode type. Property: IsValid 88
Property: IsSizeOk IsSizeOk bool read only Returns TRUE if the barcode is displayed correct. If it's FALSE, the barcode cannot be displayed because the controls dimensions are too small to display the barcode correct. Property: IsSizeOk 89
Property: Checksum Checksum long read only Returns the check digit. Property: Checksum 90
Property: Picture Picture pictureobject read only Returns the barcode picture. Property: Picture 91
Property: BackColor BackColor OLE_Color Background color of the barcode. Examples: White BackColor Green BackColor Property: BackColor 92
Property: ForeColor ForeColor OLE_Color Foreground color of the barcode. Examples: Black Forecolor Green Forecolor Property: ForeColor 93
Property: Font Font fontobject Specifies the font by name, style, effects and the size for the text line. The Font property is an object which illustrates the different properties of the font. General the usage of the font object is as follows:: Change the size: Barcode1.Font.Size = 10 Change the Font: Barcode1.Font.Name = "Arial" Change the style and the effects: Barcode1.Font.Bold = True Barcode1.Font.Italic = True Barcode1.Font.Underline = True Barcode1.Font.Strikethrough = True In some developing environments these properties are determined by enumeration types, e.g. Delphi. Have a look in the help of the developing system for information how to handle them. Examples: Font: Arial, 12pt, Bold Font: Comix, 14pt, Standard Property: Font 94
Property: Version Version char read only Returns the controls version number. Property: Version 95
Property: BorderHeight BorderHeight long BorderHeight sets the height of the border above and under the barcode in pixels. The border is painted in the current background color (BackColor). Examples: BorderHeight=4 BorderHeight=20 Property: BorderHeight 96
Property: BorderWidth BorderWidth long BorderWidth sets the width of the border on the left and the right of the barcode in pixels. The border is painted in the current background color (BackColor). Property: BorderWidth 97
Property: MaxBorderHeight MaxBorderHeight long read only MaxBorderHeight returns the maximum possible value of BorderHeight. Property: MaxBorderHeight 98
Property: MaxBorderWidth MaxBorderWidth long read only MaxBorderWidth returns the maximum possible value of BorderWidth. Property: MaxBorderWidth 99
Property: NotchHeightInPercent NotchHeightInPercent long Sets the length of the notches in percent. Examples: NotchHeightInPercent=50 NotchHeightInPercent=100 NotchHeightInPercent=0 Property: NotchHeightInPercent 100
Property: PrintFix PrintFix bool If you have the problem that the bars of the code are too thin when printing (i.e. with Excel), set this property to true. Property: PrintFix 101
Property: AutoType AutoType bool This property should not be used. It's only implemented for compatibility purposes to old versions. ActiveBarcde tries to detect the barcode type automatically. Property: AutoType 102
Method: CopyToClipboard CopyToClipboard : bool Copies the barcode in meta graphic format to the clipboard. Returns TRUE if successful. Method: CopyToClipboard 103
Method: CopyToClipboardBySize CopyToClipboardBySize (Width: Integer, Height: Integer): Bool Copies the barcode in meta graphic format to the clipboard. The size of the barcode is specified by the arguments width and height. Returns TRUE if successful. Method: CopyToClipboardBySize 104
Method: CreatePictureBySize CreatePictureBySize (Width: Integer, Height: Integer): Bool Allows a custom sized Picture property to be handled. The size of the barcode picture is specified by the arguments width and height. Returns TRUE if successful. Method: CreatePictureBySize 105
Method: SaveAs SaveAs (path: WideString): Smallint Saves the current barcode as image file (BMP, JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP and XPM). The image size is the current size of the control. The image file type used is defined by the extension of the file name (e.g. BMP for a Windows Bitmap). This method supports the following image formats: Windows Bitmap (BMP), JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, Wireless Bitmap (WBMP) and XPM. Related topic: Image file options Method: SaveAs 106
Method: SaveAsBySize SaveAsBySize (path: WideString, Width: Integer, Height: Integer): Smallint Saves the current barcode as image file (BMP, JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, WBMP and XPM). The image size is specified by the parameters width and height. The image file type used is defined by the extension of the file name (e.g. BMP for a Windows Bitmap). This method supports the following image formats: Windows Bitmap (BMP), JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, Wireless Bitmap (WBMP) and XPM. Related topic: Image file options Method: SaveAsBySize 107
Method: SaveAsBySizeExtended SaveAsBySizeExtended (path: WideString, Width: Integer, Height: Integer, Format: Integer, ColorDepth: Integer, Transparent: Integer, Flags: Integer, Angle: Integer, DPI: Integer): Smallint Extended version of the SaveAsBySize Method. Saves the current barcode as image file. The image size is specified by the parameters width and height. The image file type is specified by the parameter format. Set it to 1 if you want to use the automatic file type selection by the file names extension. The color depth is set in bit (1,8,16,24,32). The option transparent is not implemented yet. Set it to 0 if not transparency is wanted and to 1 to set the background transparent. Use the flags for special options. The option angle is used to rotate the image. Set the rotation in degrees (0 359). To overrule this option with the currect setting of the rotate property set angle to 1. Use the parameters dpi to set a specific resolution in DPI for the image file. This can be used in the image formats BMP, JPEG, TIF and PNG. (0=set no DPI value) Here you can see a list of the supported image file types, color depths and flags. This method supports the following image formats: Windows Bitmap (BMP), JPEG, PNG, TIFF, Targa, GIF, WMF, EMF, PBM, PGM, PPM, Wireless Bitmap (WBMP) and XPM. Return values of this function: 0 : File save ok. No errors. 1 : Error while saving file. 2 : Wrong colordepth for this file format 3 : Colordepth/angle combination not possible 4 : Filetype not supported 5 : Low memory 6 : Low memory 7 : Low memory Method: SaveAsBySizeExtended 108
Method: SaveAsBySizeExtended 109
ActiveBarcode Control: Image file options Supported image file formats The functions SaveAs, SaveAsBySize and SaveAsBySizeExtended of the ActiveBarcode Control support different image formats and color depths: Image format Extension Format 1 bit s/w 8 bit 16 bit 24 bit 32 bit Windows Bitmap BMP 0 yes yes yes yes default JPEG JPG, JPEG 2 gray default Portable Network Graphic PNG 13 yes yes default yes TIFF TIF 18 yes yes default yes Targa TGA 17 yes yes default yes GIF GIF 25 yes default Windows Metafile Format Enhanced Metafile Format WMF 101 default EMF 100 default Wireless Bitmap WBM, WBMP 19 default Portable Bit Map PBM 7 default Portable Gray Map PGM 11 gray/default Portable Pixel Map PPM 14 default X Pix Map XPM 23 default Color depths marked as default are used when you use the SaveAs, SaveAsBySize function or when you set the color depth to zero when using the function SaveAsBySizeExtended. Color depths for image files Supported color depths are: colordepth Description 1 1 bit monochrome, the image will be b/w. 8 8 bit colours or grayscale depending on the image format 16 16 bit TrueColor 24 24 bit TrueColor 32 32 bit TrueColor Please note that not every color depth is available for every image file format. ActiveBarcode Control: Image file options 110
Supported flags for image files You can use the following flags when saving image files: Image format Flag Description BMP JPG, JPEG 0x1 0x80 0x100 0x200 0x400 0x800 Saves the bitmap as RLE (Run Length Encoded) JPEG Qualität "Super" (100%) JPEG Qualität "Good" (75%) JPEG Qualität "Normal" (50%) JPEG Qualität "Average" (25%) JPEG Qualität "Poor" (10%) DPI settings When saving as JPEG, PNG, TIFF or BMP image format you can set the DPI (Dots per Inch), if you are using the SaveAsBySizeExtended method. ActiveBarcode Control: Image file options 111
Method: SetDemoText SetDemoText Sets the property Text to a valid default value. Use this for demonstration or test purposes to get a valid code. Method: SetDemoText 112
Method: AboutBox AboutBox Opens the info dialog of ActiveBarcode and shows Version and other details. Example: Aboutbox Method: AboutBox 113
Method: BinaryWriteAsPNGBySize BinaryWriteAsPNGBySize (Width: Integer, Height: Integer): OleVariant Returns the current barcode in binary PNG image format. The size is specified by Width and Height parameters. This method is only available in the Enterprise Edition. Method: BinaryWriteAsPNGBySize 114
Method: BinaryWriteAsPNG BinaryWriteAsPNG : OleVariant Returns the current barcode in current size binary PNG image format. This method is only available in the Enterprise Edition. Method: BinaryWriteAsPNG 115
Method: SaveAsPNG SaveAsPNG (path: WideString): Smallint Saves the current barcode as PNG image file. The image size is the current size of the control. Tip: This function has become outdated and is contained in ActiveBarcode only for reasons of compatibility. You should use the function SaveAs instead which supports more file formats. Method: SaveAsPNG 116
Method: SaveAsPNGBySize SaveAsPNGBySize (path: WideString, Width: Integer, Height: Integer): Smallint Saves the current barcode as PNG image file. The image size is specified by the paramters width and height. Tip: This function has become outdated and is contained in ActiveBarcode only for reasons of compatibility. You should use the function SaveAsBySize instead which supports more file formats. Method: SaveAsPNGBySize 117
Event: TypeChange TypeChange (BarcodeType:long) Is triggered when the barcode type is changed. The property Type is passed and can be used. Event: TypeChange 118
Event: TextChange TextChange (Text:char) Is triggered when the barcode text is changed. The property Text is passed and can be used. Event: TextChange 119
Event: ShowTextChange ShowTextChange (ShowText:bool) Is triggered when the display of the barcode text enabled or disabled. The property ShowText is passed and can be used. Event: ShowTextChange 120
Event: AutoTypeChange AutoTypeChange (AutoType:bool) Is triggered when the Autotype option is enabled or disabled. The property Autotype is passed and can be used. Event: AutoTypeChange 121
Event: PrintFixChange PrintFixChange (PrintFix:bool) Is triggered when the PrintFix option is enabled or disabled. The property PrintFix is passed and can be used. Event: PrintFixChange 122
Information for developers To use this functionality you require the Enterprise Edition Distribution of the ActiveX Control with your own programs e.g. developed with C++, C#, Visual Basic, Delphi etc. The following information is only for owners of the Enterprise Edition. If you own a Standard Edition, you have no license to distribute any files. If you create an application with the ActiveBarcode ActiveX Control (OCX) and want to distribute, you must make sure that certain files on the target system are installed or exist. Your are only allowed to distribute the ActiveX Control of ActiveBarcode (activebarcode.ocx) and the necessary DLL's (mfc42.dll, msvcrt.dll, olepro32.dll). If you distribute other files, as for example the ActiveBarcode Application or a license file (*.lic), this is an offense against the license. Please always be sure, that you only distribute the files you are allowed to. The ActiveX Control (OCX) must be registered in the system before it can be used. You can do this from the command prompt with the following command: regsvr32 activebarcode.ocx Open the command prompt with administrator rights, otherwise the registration in the system can fail. When using x64 Windows please launch the regsvr32.exe application from the \Windows\System32 or \Windows\SysWOW64 folder. (Example: regsvr32 "c:\program files (x86)\activebarcode\activebarcode.ocx") This application (regsvr32) is included with Windows. A lot of installations tools (as for example Inno setup) can do this registration during the installation, so that the above manual registration is not necessary. Please note that you have no permission to distribute an application that's exclusive purpose it is to create barcodes. Required DLL's ActiveBarcode required some system DLL's to run properly. If you run the setup of ActiveBarcode these DLL's are automatically installed or updated. If you distribute ActiveBarcode with your application, you'll need to ensure that the DLL's on the target system are available at least in the following versions: mfc42.dll 4.21.0.7022 msvcrt.dll 5.0.4058.1 olepro32.dll 5.0.0.7022 Current Windows versions already carry this or newer versions and there is no need to update them. Our experiences point that there is no need to update these DLL's in Windows 98SE or above. Information for developers 123