You are on page 1of 127

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 2005XE2 Barcodes in projects.........................................................................................................19
Delphi 47 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

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 stepbystep 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

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
ActiveBarcodeTrial5.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
ActiveBarcode | Lars Schenk & Frank Horn

Setup ActiveBarcode

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

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

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

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

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

ActiveBarcode | Lars Schenk & Frank Horn

Visual Studio 2012 Barcodes in projects

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

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

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

ActiveBarcode | Lars Schenk & 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 EAN13 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

ActiveBarcode | Lars Schenk & Frank Horn

Visual C# and C++ Barcodes in projects

18

Delphi 2005XE2
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 (47) 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 2005XE2 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 2005XE2 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 2005XE2 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 2005XE2 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

ActiveBarcode | Lars Schenk & Frank Horn

Delphi 2005XE2 Barcodes in projects

23

Delphi 47
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 47 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 47 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, EAN8, EAN13, EAN18, EAN 128,
GS1128, GS1Data Matrix, GTIN8, GTIN12, GTIN13, Bookland, ITF14, PDF417, QR
Code, SCC14, SSCC18, UCC128, UPCA, UPCE.
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 47 Barcodes in projects

26

This manual was created by Frank Horn

ActiveBarcode | Lars Schenk & Frank Horn

Delphi 47 Barcodes in projects

27

VisualBasicScript
Barcodes in projects

ActiveBarcode in VisualBasicScript (Windows Scritping Host)


You can use ActiveBarcode with VisualBasicScript (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 VisualBasicScript 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

ActiveBarcode | Lars Schenk & 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

ActiveBarcode | Lars Schenk & 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

ActiveBarcode | Lars Schenk & Frank Horn

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 EAN128 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 "ActiveBarcodeObject" 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, EAN8, EAN13, EAN18, EAN 128, GS1128, GS1Data Matrix,
GTIN8, GTIN12, GTIN13, Bookland, ITF14, PDF417, QR Code, SCC14, SSCC18,
UCC128, UPCA, UPCE.
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 EAN128 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

ActiveBarcode | Lars Schenk & 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 EAN128 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
"ActiveBarcodeObject" 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, EAN8, EAN13, EAN18, EAN 128, GS1128, GS1Data Matrix, GTIN8,
GTIN12, GTIN13, Bookland, ITF14, PDF417, QR Code, SCC14, SSCC18, UCC128,
UPCA, UPCE.
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 EAN128 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

ActiveBarcode | Lars Schenk & 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 EAN128 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 "ActiveBarcodeObject" 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, EAN8, EAN13, EAN18, EAN 128, GS1128, GS1Data Matrix,
GTIN8, GTIN12, GTIN13, Bookland, ITF14, PDF417, QR Code, SCC14, SSCC18,
UCC128, UPCA, UPCE.
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 EAN128 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

ActiveBarcode | Lars Schenk & 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 EAN128 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 "ActiveBarcodeObject" 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, EAN8, EAN13, EAN18, EAN 128,
GS1128, GS1Data Matrix, GTIN8, GTIN12, GTIN13, Bookland, ITF14, PDF417, QR Code,
SCC14, SSCC18, UCC128, UPCA, UPCE.
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 EAN128 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

ActiveBarcode | Lars Schenk & 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 EAN128 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 "ActiveBarcodeObject" 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, EAN8, EAN13, EAN18, EAN 128, GS1128, GS1Data Matrix,
GTIN8, GTIN12, GTIN13, Bookland, ITF14, PDF417, QR Code, SCC14, SSCC18,
UCC128, UPCA, UPCE.
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 EAN128 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

ActiveBarcode | Lars Schenk & 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 EAN128 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 "ActiveBarcodeObject" 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, EAN8, EAN13, EAN18, EAN 128, GS1128, GS1Data Matrix,
GTIN8, GTIN12, GTIN13, Bookland, ITF14, PDF417, QR Code, SCC14, SSCC18,
UCC128, UPCA, UPCE.
In this example we use the EAN128, 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 EAN128 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

ActiveBarcode | Lars Schenk & 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
Fullsize
properties, methods and events of
view
ActiveBarcode. Please select one of PDF
Download
the following chapters to get
descriptions on:
Properties
Methods
Events
The property dialog
Information about distributing
the ActiveX control (Enterprise
Edition, Developer licence)

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, DUN14, EAN2, EAN5, EAN8, EAN13, EAN14, EAN18, EAN99, EAN 128,
EANVelocity, GS1128, GS1Data Matrix, GTIN8, GTIN12, GTIN13, GTIN14, Identcode,
ISBN10, ISBN13, ISBN13 Dual, Bookland, ISSN, ISMN, ITF14, JAN, Leitcode, MSI, NVE,
PDF417, PostNet, PZN7, PZN8, QR Code, Royal Mail SCC14, SSCC18, UCC128, UPCA
and UPCE

FAQ
If you have further questions or problems, please have a look at our FAQ.
ActiveBarcode | Lars Schenk & Frank Horn

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, DUN14, EAN2, EAN5, EAN8, EAN13, EAN14,
EAN18, EAN99, EAN 128, EANVelocity, GS1128, GS1Data Matrix, GTIN8, GTIN12,
GTIN13, GTIN14, Identcode, ISBN10, ISBN13, ISBN13 Dual, Bookland, ISSN, ISMN,
ITF14, JAN, Leitcode, MSI, NVE, PDF417, PostNet, PZN7, PZN8, QR Code, Royal Mail
SCC14, SSCC18, UCC128, UPCA and UPCE
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

ActiveBarcode | Lars Schenk & Frank Horn

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 |

ActiveBarcode | Lars Schenk & Frank Horn

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 |

ActiveBarcode | Lars Schenk & Frank Horn

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 |

ActiveBarcode | Lars Schenk & Frank Horn

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 EAN13 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
text=
type=
width=
height=

Description
text to be encoded
barcode type
width in pixels
height in pixels
Alignment
1=left
alignment=
2=center
3=right
borderwidth=
borderwidth in pixels
borderheight=
borderheight in pixels
notchheightinpercent= the notch height in %
showtext=off
no textline under the code
sets the foreground color
forecolor=
hexadecimal RGB as RRGGBB
sets the background color
backcolor=
hexadecimal RGB as RRGGBB
fontname=
font for the text line
fontsize=
font size
fontbold=
font bold (on/off)
fontitalic=
font italic (on/off)
fontunderline=
font underline (on/off)
fontstrikeout=
font strikeout (on/off)
file type of image
(valid values: bmp, jpg, png, tif, tga, gif,
filetype=
wbm, pbm, pgm, ppm, xpm, wmf, emf)
Default: auto detect by extension of
filename
colordepth of the image file
colordepth=
(valid values: 1,8,16,24,36)
flags=
flags for the image file
rotates the image file
angle=
(valid values: 0359)
background transparency
transparent=
(valid values: 0, 1, not implemented yet)
resolution in DPI for jpg, png, tif & bmp
dpi=
files
off: display no messages
errors: display only errors
echo=
verbose:display all messages and open
barcode in ImageView

ActiveBarcode Commandline Tool

Example
text=123456789012
type=0
width=500
height=500
alignment=2
borderwidth=10
borderheight=1
notchheightinpercent=25
showtext=off
foreground=000000
(example is black)
background=FFFFFF
(example is white)
fontname=arial
fontsize=8
fontbold=on
fontitalic=on
fontunderline=on
fontstrikeout=on

filetype=bmp

colordepth=24
flags=0x80
angle=180
transparent=1
dpi=300
echo=off
echo=errors
echo=verbose

66

64bit Windows
If you want to use the barcodeimage.wsf program under Windows 64bit, you need to run the
barcodeimage.wsf in 32bit, as the control is 32bit 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 BarcodeImageDemo.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 | Lars Schenk & Frank Horn

ActiveBarcode Commandline Tool

67

Barcode types
ActiveBarcode supports the following barcode types:
ActiveBarcode calculates the check digit where available automatically for you.

Code
Code 128

Beispiel

Length Character set Description


variable

ASCII (128
chars)

Modern 1D type of barcode. Has


highly copmpressed data. Very often
used.

GS1128,
EAN128,
UCC128

variable

ASCII (128
chars)

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.

EAN13,
GTIN13

13

numeric 09

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 MobileTagging with cell phones.

Data Matrix

variable ASCII

2D barcode for encoding mass text


or data in only one code.

GS1Data
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.

EAN8,
GTIN8

numeric 09

This is the short version of EAN13


for extremly small products.

PDF417

variable ASCII

2D barcode for encoding mass text


or data in only one code.

ISBN13

13

numeric 09

International Standard Book


Number. ISBN standard type since
01. January 2007.

ISSN

numeric 09

International Standard Serial


Number. The ISSN serves the short
unmistakeable identification of
sequentially appearing publications,
e.g., magazines.

ISMN

10

numeric 09

The ISMN (Internationally Standard


Music Number) is used for marking
printed musical publications.

Barcode types

68

EAN14,
GTIN14

14

numeric 09

The EAN 14 code is used for traded


goods

DUN14

14

numeric 09

Distribution Unit Number. Also have


a look at EAN14 and ITF14.

SCC14

14

numeric 09

Shipping Container Symbol. Also


have a look at EAN14 and ITF14.

ITF14

14

numeric 09

The ITF14 barcode is used to


create the Shipping Container
Symbol. This code is used to mark
cartons and palettes that are
including goods with an EAN13
code.

EAN18/NVE

18

numeric 09

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.

SSCC18

18

numeric 09

UPCA,
GTIN12

12

numeric 09

UPCE

numeric 09

Code 39

variable

AZ, 09, 5
Also known as Code 3 of 9. Often
special chars used type that is self checking.

Code 39
Extended

variable

ASCII (127
chars)

Code 25

variable numeric 09

Also known as Code 2 of 5 and


Code 25 Industrial. Rather old code
for industrial use.

Code 25
Interleaved

variable numeric 09

Also known as Code 2 of 5


Interleaved. Industrial use.

JAN

13

Japanese Article Numbering. It's


primarily used in supermarkets to
identify product at the point of sales.

Barcode types

numeric 09

This is the short version of UPCA


for extremly small products.

Also known as Code 3 of 9


Extended. Extension of Code 39.

69

EAN5

numeric 09

AddOn code. For example for books


(see ISBN).

EAN2

numeric 09

AddOn code. For example for


magazines.
"EAN99 is a special form of the
EAN13, which just starts with
""99"". EAN 99 is used as an
instore coupon."
EANVelocity is a special form of the
EAN8. This code is internally used
by dealers for products that have no
EAN13 or EAN8 code from the
producer.
International Standard Book
Number. ISBN transitional type from
01. January 2006 to 31. December
2006.

EAN99

13

numeric 09

EANVelocity

numeric 09

ISBN13 Dual

13

numeric 09

ISBN10

13

numeric 09

Codabar

variable

09, 6 special Old barcode type. Often used in


characters
medicine in the past.

Code 93

variable

Same characterset as Code 39 but


AZ, 09, 5
more compacted code that requires
special chars
less space.

Code 93
Extended

variable

ASCII (127
chars)

Same characterset as Code 39


Extended but more compacted code
that requires less space.

PZN7

numeric 09

Pharmazentralnummer fr medicine.
Special form of Code 39.

PZN8

numeric 09

Pharmazentralnummer fr medicine.
Special form of Code 39.

Leitcode

14

numeric 09

The Leitcode is used by Deutschen


Post/DHL.

Identcode

12

numeric 09

The Identcode is used by Deutschen


Post/DHL.

Barcode types

International Standard Book


Number. ISBN standard type until
31. December 2005.

70

Code 128A

Uppercase
letters and
variable
control
characters

Subcode of Code 128. This type is


normally not used for itself. Use
Code 128 or EAN 128 instead.

Code 128B

Upper and
variable 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 09

Subcode of Code 128. This type is


normally not used for itself. Use
Code 128 or EAN 128 instead.

MSI Plessey

variable numeric 09

Old code typ. Was used for goods


and books in the past.

PostNet

variable numeric 09

This code us used to improve the


speed of sorting and delivering of
mail.

Royal Mail

variable AZ, 09

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.
ActiveBarcode | Lars Schenk & Frank Horn

Barcode types

71

OCX: Properties
Properties of des Controls
Name

Description
Text contains the content of the barcode.
Text
char
General without check digit.
TRUE: The barcode has a human readable
text. (default)
ShowText
bool
FALSE: The barcode is displayed without
the text.
Type
long
Specifies the barcode type.
Rotate contains the orientation of the
Rotate
long
displayed barcode in degreess
(0,90,180,270).
Alignment sets the alignment (on the left,
on the right, centered) of the barcode. You
Alignment
AlignConstants
can pass AlignLeft, AlignCenter or
AlignRight.
TypeName
char
Contains the name of the barcode type.
Returns TRUE if the barcode is valid. If it's
IsValid
bool
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
IsSizeOk
bool
be displayed because the controls
dimensions are too small to display the
barcode correct.
Checksum
long
Returns the check digit.
Picture
pictureobject
Returns the barcode picture.
BackColor
OLE_Color
Background color of the barcode.
ForeColor
OLE_Color
Foreground color of the barcode.
Specifies the font by name, style, effects
Font
fontobject
and the size for the text line.
Version
char
Returns the controls version number.
BorderHeight sets the height of the border
above and under the barcode in pixels.
BorderHeight
long
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
BorderWidth
long
pixels. The border is painted in the current
background color (BackColor).
MaxBorderHeight returns the maximum
MaxBorderHeight
long
possible value of BorderHeight.
MaxBorderWidth returns the maximum
MaxBorderWidth
long
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

OCX: Properties

Type

readonly

readonly

readonly

readonly
readonly

readonly

readonly
readonly

72

AutoType

bool

Excel), set this property to true.


This property should not be used. It's only
implemented for compatibility purposes to

old versions. ActiveBarcde tries to detect


the barcode type automatically.

ActiveBarcode | Lars Schenk & Frank Horn

OCX: Properties

73

OCX: Methods
Methods of the Control
Name

Description
Copies the barcode in meta graphic
CopyToClipboard
: bool
format to the clipboard. Returns TRUE if
successful.
Copies the barcode in meta graphic
format to the clipboard. The size of the
(Width: Integer, Height:
CopyToClipboardBySize
barcode is specified by the arguments
Integer): Bool
width and height. Returns TRUE if
successful.
Allows a custom sized Picture property
to be handled. The size of the barcode
(Width: Integer, Height:
CreatePictureBySize
picture is specified by the arguments
Integer): Bool
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
(path: WideString):
and XPM). The image size is the current
SaveAs
Smallint
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
(path: WideString, Width:
and XPM). The image size is specified
SaveAsBySize
Integer, Height: Integer):
by the parameters width and height. The
Smallint
image file type used is defined by the
extension of the file name (e.g. BMP for
a Windows Bitmap).
(path: WideString, Width:
Integer, Height: Integer,
Format: Integer,
ColorDepth: Integer,
Extended version of the SaveAsBySize
SaveAsBySizeExtended
Transparent: Integer,
Method.
Flags: Integer, Angle:
Integer, DPI: Integer):
Smallint
Sets the property Text to a valid default
SetDemoText

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
(Width: Integer, Height:
BinaryWriteAsPNGBySize
by Width and Height parameters. This
Integer): OleVariant
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

Parameter

74

AboutBox
SaveAsPNG

SaveAsPNGBySize

Enterprise Edition.
Opens the info dialog of ActiveBarcode

and shows Version and other details.


Saves the current barcode as PNG
(path: WideString):
image file. The image size is the current
Smallint
size of the control.
(path: WideString, Width: Saves the current barcode as PNG
Integer, Height: Integer): image file. The image size is specified
Smallint
by the paramters width and height.

ActiveBarcode | Lars Schenk & Frank Horn

OCX: Methods

75

OCX: Events
Events of the Control
Name

Parameter

Description
Is triggered when the barcode type is changed. The
TypeChange
BarcodeType:long
property Type is passed and can be used.
Is triggered when the barcode text is changed. The
TextChange
Text:char
property Text is passed and can be used.
Is triggered when the display of the barcode text
ShowTextChange ShowText:bool
enabled or disabled. The property ShowText is passed
and can be used.
Is triggered when the Autotype option is enabled or
AutoTypeChange AutoType:bool
disabled. The property Autotype is passed and can be
used.
Is triggered when the PrintFix option is enabled or
PrintFixChange
PrintFix:bool
disabled. The property PrintFix is passed and can be
used.

ActiveBarcode | Lars Schenk & Frank Horn

OCX: Events

76

Property: Text
Text char
Text contains the content of the barcode. General without check digit.

ActiveBarcode | Lars Schenk & Frank Horn

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

ActiveBarcode | Lars Schenk & Frank Horn

Property: ShowText

78

Property: Type
Type long
Specifies the barcode type.

value long
0
1 (default)
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Property: Type

Code
ISBN10
EAN 13
EAN 8
EAN 5
EAN 2
UPC A
Code 39
Code 25
Interleaved
Codabar
Code 25
Industrial
Code 39
Extended
Code 128A
Code 128B
Code 128C
Code 128
EAN/UCC 128
EAN 99
UPC E
PostNet
Royal Mail
MSI
Code 93
Code 93
Extended
PZN7
Identcode
Leitcode
Code 39
Checksum
Code 39
Extended
Checksum
EAN/UCC 128 AI
EAN 14
ITF14
EAN18/NVE

Name
CODEISBN
CODEEAN13
CODEEAN8
CODEEAN5
CODEEAN2
CODEUPCA
CODE39
CODE25I
CODABAR
CODE25
CODE39E
CODECODE128A
CODECODE128B
CODECODE128C
CODECODE128
CODEEAN128
CODEEAN99
CODEUPCE
CODEPOSTNET
CODEROYALMAIL
CODEMSI
CODE93
CODE93E
CODEPZN8
CODEINDENTCODE
CODELEITCODE
CODE39CHECKSUM
CODE39ECHECKSUM
CODEEAN128AI
CODEEAN14
CODEITF14
CODEEAN18
79

32
33
34

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

Property: Type

SSCC18
Codabar
Checksum
Code 25
Interleaved
Checksum
Code 25
Industrial
Checksum
PDF417
DataMatrix
ISBN13
ISBN13 Dual
ISSN
ISMN
DataMatrix
Square
DataMatrix
Rectangular
DataMatrix
10x10
DataMatrix
12x12
DataMatrix 8x18
DataMatrix
14x14
DataMatrix 8x32
DataMatrix
16x16
DataMatrix
12x26
DataMatrix
18x18
DataMatrix
20x20
DataMatrix
12x36
DataMatrix
22x22
DataMatrix
16x36
DataMatrix
24x24
DataMatrix
26x26
DataMatrix
16x48
DataMatrix
32x32

CODESSCC18
CODABARCHECKSUM
CODE25ICHECKSUM

CODE25CHECKSUM
CODEPDF417
CODEDATAMATRIX
CODEISBN13
CODEISBN13DUAL
CODEISSN
CODEISMN
CODEDATAMATRIXSQUARE
CODEDATAMATRIXRECTANGULAR
CODEDATAMATRIX10X10
CODEDATAMATRIX12X12
CODEDATAMATRIX8X18
CODEDATAMATRIX14X14
CODEDATAMATRIX8X32
CODEDATAMATRIX16X16
CODEDATAMATRIX12X26
CODEDATAMATRIX18X18
CODEDATAMATRIX20X20
CODEDATAMATRIX12X36
CODEDATAMATRIX22X22
CODEDATAMATRIX16X36
CODEDATAMATRIX24X24
CODEDATAMATRIX26X26
CODEDATAMATRIX16X48
CODEDATAMATRIX32X32

80

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Property: Type

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
GS1Data Matrix
GS1Data Matrix
Square
GS1Data Matrix
Rectangular
GS1Data Matrix
10x10
GS1Data Matrix
12x12
GS1Data Matrix
8x18
GS1Data Matrix
14x14
GS1Data Matrix
8x32
GS1Data Matrix
16x16
GS1Data Matrix
12x26
GS1Data Matrix
18x18

CODEDATAMATRIX36X36
CODEDATAMATRIX40X40
CODEDATAMATRIX44X44
CODEDATAMATRIX48X48
CODEDATAMATRIX52X52
CODEDATAMATRIX64X64
CODEDATAMATRIX72X72
CODEDATAMATRIX80X80
CODEDATAMATRIX88X88
CODEDATAMATRIX96X96
CODEDATAMATRIX104X104
CODEDATAMATRIX120X120
CODEDATAMATRIX132X132
CODEDATAMATRIX144X144
CODEGS1DATAMATRIX
CODEGS1DATAMATRIXSQUARE
CODEGS1DATAMATRIXRECTANGULAR
CODEGS1DATAMATRIX10X10
CODEGS1DATAMATRIX12X12
CODEGS1DATAMATRIX8X18
CODEGS1DATAMATRIX14X14
CODEGS1DATAMATRIX8X32
CODEGS1DATAMATRIX16X16
CODEGS1DATAMATRIX12X26
CODEGS1DATAMATRIX18X18
CODEGS1DATAMATRIX20X20
81

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Property: Type

GS1Data Matrix
20x20
GS1Data Matrix
12x36
GS1Data Matrix
22x22
GS1Data Matrix
16x36
GS1Data Matrix
24x24
GS1Data Matrix
26x26
GS1Data Matrix
16x48
GS1Data Matrix
32x32
GS1Data Matrix
36x36
GS1Data Matrix
40x40
GS1Data Matrix
44x44
GS1Data Matrix
48x48
GS1Data Matrix
52x52
GS1Data Matrix
64x64
None
GS1Data Matrix
72x72
GS1Data Matrix
80x80
GS1Data Matrix
88x88
GS1Data Matrix
96x96
GS1Data Matrix
104x104
GS1Data Matrix
120x120
GS1Data Matrix
132x132
GS1Data Matrix
144x144
GS128
GTIN8
GTIN12
GTIN13
GTIN14

CODEGS1DATAMATRIX12X36
CODEGS1DATAMATRIX22X22
CODEGS1DATAMATRIX16X36
CODEGS1DATAMATRIX24X24
CODEGS1DATAMATRIX26X26
CODEGS1DATAMATRIX16X48
CODEGS1DATAMATRIX32X32
CODEGS1DATAMATRIX36X36
CODEGS1DATAMATRIX40X40
CODEGS1DATAMATRIX44X44
CODEGS1DATAMATRIX48X48
CODEGS1DATAMATRIX52X52
CODEGS1DATAMATRIX64X64
CODENONE
CODEGS1DATAMATRIX72X72
CODEGS1DATAMATRIX80X80
CODEGS1DATAMATRIX88X88
CODEGS1DATAMATRIX96X96
CODEGS1DATAMATRIX104X104
CODEGS1DATAMATRIX120X120
CODEGS1DATAMATRIX132X132
CODEGS1DATAMATRIX144X144
CODEGS1128
CODEGTIN8
CODEGTIN12
CODEGTIN13
CODEGTIN14
82

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Property: Type

QR Code
QR Code ECC
Level L
QR Code ECC
Level M
QR Code ECC
Level Q
QR Code ECC
Level H
QR Code 21x21
QR Code 25x25
QR Code 29x29
QR Code 33x33
QR Code 37x37
QR Code 41x41
QR Code 45x45
QR Code 49x49
QR Code 53x53
QR Code 57x57
QR Code 61x61
QR Code 65x65
QR Code 69x69
QR Code 73x73
QR Code 77x77
QR Code 81x81
QR Code 85x85
QR Code 89x89
QR Code 93x93
QR Code 97x97
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

CODEQRCODE
CODEQRCODEECCLEVELL
CODEQRCODEECCLEVELM
CODEQRCODEECCLEVELQ
CODEQRCODEECCLEVELH
CODEQRCODE21X21
CODEQRCODE25X25
CODEQRCODE29X29
CODEQRCODE33X33
CODEQRCODE37X37
CODEQRCODE41X41
CODEQRCODE45X45
CODEQRCODE49X49
CODEQRCODE53X53
CODEQRCODE57X57
CODEQRCODE61X61
CODEQRCODE65X65
CODEQRCODE69X69
CODEQRCODE73X73
CODEQRCODE77X77
CODEQRCODE81X81
CODEQRCODE85X85
CODEQRCODE89X89
CODEQRCODE93X93
CODEQRCODE97X97
CODEQRCODE101X101
CODEQRCODE105X105
CODEQRCODE109X109
CODEQRCODE113X113
CODEQRCODE117X117
CODEQRCODE121X121
CODEQRCODE125X125
CODEQRCODE129X129
CODEQRCODE133X133
CODEQRCODE137X137
83

148
149
150
151
152
153
154
155
156
157
158

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
PZN8

CODEQRCODE141X141
CODEQRCODE145X145
CODEQRCODE149X149
CODEQRCODE153X153
CODEQRCODE157X157
CODEQRCODE161X161
CODEQRCODE165X165
CODEQRCODE169X169
CODEQRCODE173X173
CODEQRCODE177X177
CODEPZN8

ActiveBarcode | Lars Schenk & Frank Horn

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

ActiveBarcode | Lars Schenk & Frank Horn

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;

ActiveBarcode | Lars Schenk & Frank Horn

Property: Alignment

86

Property: TypeName
TypeName char
Contains the name of the barcode type.

ActiveBarcode | Lars Schenk & Frank Horn

Property: TypeName

87

Property: IsValid
IsValid bool readonly
Returns TRUE if the barcode is valid. If it's invalid, the text cannot be coded with the selected
barcode type.

ActiveBarcode | Lars Schenk & Frank Horn

Property: IsValid

88

Property: IsSizeOk
IsSizeOk bool readonly
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.

ActiveBarcode | Lars Schenk & Frank Horn

Property: IsSizeOk

89

Property: Checksum
Checksum long readonly
Returns the check digit.

ActiveBarcode | Lars Schenk & Frank Horn

Property: Checksum

90

Property: Picture
Picture pictureobject readonly
Returns the barcode picture.

ActiveBarcode | Lars Schenk & Frank Horn

Property: Picture

91

Property: BackColor
BackColor OLE_Color
Background color of the barcode.
Examples:

White BackColor

Green BackColor

ActiveBarcode | Lars Schenk & Frank Horn

Property: BackColor

92

Property: ForeColor
ForeColor OLE_Color
Foreground color of the barcode.
Examples:

Black Forecolor

Green Forecolor

ActiveBarcode | Lars Schenk & Frank Horn

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

ActiveBarcode | Lars Schenk & Frank Horn

Property: Font

94

Property: Version
Version char readonly
Returns the controls version number.

ActiveBarcode | Lars Schenk & Frank Horn

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

ActiveBarcode | Lars Schenk & Frank Horn

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).

ActiveBarcode | Lars Schenk & Frank Horn

Property: BorderWidth

97

Property: MaxBorderHeight
MaxBorderHeight long readonly
MaxBorderHeight returns the maximum possible value of BorderHeight.

ActiveBarcode | Lars Schenk & Frank Horn

Property: MaxBorderHeight

98

Property: MaxBorderWidth
MaxBorderWidth long readonly
MaxBorderWidth returns the maximum possible value of BorderWidth.

ActiveBarcode | Lars Schenk & Frank Horn

Property: MaxBorderWidth

99

Property: NotchHeightInPercent
NotchHeightInPercent long
Sets the length of the notches in percent.
Examples:

NotchHeightInPercent=50

NotchHeightInPercent=100

NotchHeightInPercent=0

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

Property: AutoType

102

Method: CopyToClipboard
CopyToClipboard : bool
Copies the barcode in meta graphic format to the clipboard. Returns TRUE if successful.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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
ActiveBarcode | Lars Schenk & Frank Horn

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
ActiveBarcode | Lars Schenk & Frank Horn

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 (0359). 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

ActiveBarcode | Lars Schenk & Frank Horn

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
Windows Bitmap
JPEG
Portable Network
Graphic
TIFF
Targa
GIF
Windows Metafile
Format
Enhanced Metafile
Format
Wireless Bitmap
Portable Bit Map
Portable Gray Map
Portable Pixel Map
X Pix Map

Extension
BMP
JPG, JPEG

Format 1bit s/w 8bit


0
yes
yes
2

gray

16bit 24bit 32bit


yes
yes
default

default

PNG

13

yes

yes

default yes

TIF
TGA
GIF

18
17
25

yes

yes

yes
yes
default

yes

default yes
default yes

WMF

101

default

EMF

100

default

WBM, WBMP
PBM
PGM
PPM
XPM

19
7
11
14
23

default
default

gray/default

default
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
1
8
16
24
32

Description
1bit monochrome, the image will be b/w.
8bit colours or grayscale depending on the image format
16bit TrueColor
24bit TrueColor
32bit 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

BMP

0x1

JPG, JPEG

0x80
0x100
0x200
0x400
0x800

Description
Saves the bitmap as RLE (Run Length
Encoded)
JPEG Qualitt "Super" (100%)
JPEG Qualitt "Good" (75%)
JPEG Qualitt "Normal" (50%)
JPEG Qualitt "Average" (25%)
JPEG Qualitt "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 | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

Method: SetDemoText

112

Method: AboutBox
AboutBox
Opens the info dialog of ActiveBarcode and shows Version and other details.
Example:

Aboutbox

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.
ActiveBarcode | Lars Schenk & Frank Horn

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.
ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.

ActiveBarcode | Lars Schenk & Frank Horn

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.
ActiveBarcode | Lars Schenk & Frank Horn
Information for developers

123

You might also like