Activebarcode Developer English

127
ActiveBarcode for developers http://www.activebarcode.com/

description

Barcode

Transcript of Activebarcode Developer English

Page 1: Activebarcode Developer English

ActiveBarcode for developershttp://www.activebarcode.com/

Page 2: Activebarcode Developer English

ContentAbout 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

Page 3: Activebarcode Developer English

ContentProperty: 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

Page 4: Activebarcode Developer English

ContentMethod: 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

Page 5: Activebarcode Developer English

About this manual

This present documentation is a shortened version of the extensive online documentation. This documentouter 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 2010package. 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 HornThis document © Frank Horn

Dokument Version 2.0.270

About this manual 1

Page 6: Activebarcode Developer English

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 andhave now purchased the full version), please uninstall before installing. You need administrator'srights 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 fileActiveBarcode−Trial5.60.exe. If you have downloaded a ZIP archive, first extract the file fromthe archive. The setup application will then be launched. The setup, the control and theApplication is digital signed by 'Lars Schenk'.

Follow the instructions of this setup application. You even can cancel the setup process usingthe "Cancel" button. After the setup is complete the ActiveBarcode Control is available now inyour system and in addition to this you can now start the ActiveBarcode Application form yourStartmenu −> Programs.

Please consider that the ActiveBarcode Control is more flexible and more powerful than theActiveBarcode Application! You can find instructions of how to use ActiveBarcode Control withdiffent software here: Examples

ActiveBarcode | © Lars Schenk & Frank Horn

Setup ActiveBarcode 2

Page 7: Activebarcode Developer English

Visual Studio 2012Barcodes 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. abutton. First you have to add the ActiveBarcode control into the development environment.

Adding ActiveBarcode to the development environmentGo 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 listof 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

Page 8: Activebarcode Developer English

Create a new project. To add the ActiveBarcode Control to a form you select the function "Toolbox" fromthe "View" menu first. This opens the toolbox. "Toolbox". Have a look for the ActiveBarcode Control in thetoolbox now.

Click on ActiveBarcode there and move it the form you want to place the control. The control will then beplaced on this form.

You can change the barcode properties of the barcode control now or later. In this example we changethe background color to white:

Visual Studio 2012 Barcodes in projects 4

Page 9: Activebarcode Developer English

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 eventto change the barcodes content every time the textbox changes.

Visual Studio 2012 Barcodes in projects 5

Page 10: Activebarcode Developer English

This code example is for Visual Basic. With Visual C# you use the following code for the assignment ogthe 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

Page 11: Activebarcode Developer English

Visual Basic:

Dim MyObject As ObjectMyObject = 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 7

Page 12: Activebarcode Developer English

Visual BasicBarcodes 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 youhave to add the ActiveBarcode control into the development environment.

Adding ActiveBarcode to the development environmentGo to the menu "Tools" and select the function "Choose Toolbox items":

A dialog appears. As ActiveBarcode is a COM component first select the tab "COMComponents":

A list of the available controls will be displayed. Select "ActiveBarcode" and activate it. Thenclick OK.

Visual Basic Barcodes in projects 8

Page 13: Activebarcode Developer English

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

Page 14: Activebarcode Developer English

Click on ActiveBarcode there and move it the form you want to place the control. The control willthen be placed on this form.

You can change the barcode properties of the barcode control now or later. In this example wechange the background color to white:

Visual Basic Barcodes in projects 10

Page 15: Activebarcode Developer English

Now add a "Textbox" to this form, too.

Double click this textbox now to open the source code for the event "Textchange". We will usethis 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

Page 16: Activebarcode Developer English

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 encodedcontent "Example" is generated and saved as image file by using the SaveAsBySize function.

Dim MyObject As ObjectMyObject = 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

Page 17: Activebarcode Developer English

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). Firstyou have to add the ActiveBarcode control into the development environment.

Adding ActiveBarcode to the development environmentIn 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 "COMComponents":

A list of the available controls will be displayed. Select "ActiveBarcode" and activate it. Thenclick OK.

Visual C# and C++ Barcodes in projects 13

Page 18: Activebarcode Developer English

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

Page 19: Activebarcode Developer English

Click on ActiveBarcode there and place it into the form. The control will then be integrated onthis form.

You can change the barcode properties of the barcode control now or later. In this example wechange the background color to white:

Visual C# and C++ Barcodes in projects 15

Page 20: Activebarcode Developer English

Now add a "Textbox" to this form, too.

Double click this textbox now to open the source code for the event "Textchange". We will usethis event to change the barcodes content every time the textbox changes.

Visual C# and C++ Barcodes in projects 16

Page 21: Activebarcode Developer English

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 theencoded content "123456789012" is generated and saved as image file by using theSaveAsBySize 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 andclick with the right mouse button on "References", then select "Add Reference −> COM −>ActiveBarcode".

Visual C# and C++ Barcodes in projects 17

Page 22: Activebarcode Developer English

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

Page 23: Activebarcode Developer English

Delphi 2005−XE2Barcodes 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 toadd 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

Page 24: Activebarcode Developer English

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 beshown:

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

Page 25: Activebarcode Developer English

Use ActiveBarcode (Example)

Create a new project: "File" − "New" − "Form application VCL". To place ActiveBarcode nowonto 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 cancustomize 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

Page 26: Activebarcode Developer English

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

Page 27: Activebarcode Developer English

Image1.Picture.Bitmap.Height := Barcode1.Height;Image1.Picture.Bitmap.Width := Barcode1.Width;Barcode1.Picture.PictureAdapter := nil; // delphi workaroundImage1.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 workaroundImage1.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 2005−XE2 Barcodes in projects 23

Page 28: Activebarcode Developer English

Delphi 4−7Barcodes 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 toadd 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 clickthe "Install..." button:

Delphi 4−7 Barcodes in projects 24

Page 29: Activebarcode Developer English

Follow the instructions showing on your screen.

Now the ActiveBarcode control is added to your Delphi development environment. The barcodeicons 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 thatform. This will be a standard barcode. You can change this and all other properties of thatbarcode control in the "Object Inspector".

Delphi 4−7 Barcodes in projects 25

Page 30: Activebarcode Developer English

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, QRCode, 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 workaroundImage1.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 workaroundImage1.Picture.Bitmap.Canvas.Draw(0,0,Barcode1.Picture.graphic);Clipboard.Assign(Image1.Picture.Bitmap);

Delphi 4−7 Barcodes in projects 26

Page 31: Activebarcode Developer English

This manual was created by Frank Horn

ActiveBarcode | © Lars Schenk & Frank Horn

Delphi 4−7 Barcodes in projects 27

Page 32: Activebarcode Developer English

VisualBasicScriptBarcodes in projects

ActiveBarcode in VisualBasicScript (Windows Scritping Host)

You can use ActiveBarcode with VisualBasic−Script (VBS, Windows Scripting Host) to createbarcodes in scripts automatically. Here we show you how simple is it to use ActiveBarcode inVBS.

First make the ActiveBarcode control available in your script:

Dim barcodeSet barcode = WScript.CreateObject("BARCODE.BarcodeCtrl.1")

Now you can use the variable 'barcode' to access the control. Use the Properties of the controlto 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 codefor 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

Page 33: Activebarcode Developer English

JavaScriptBarcodes 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) atrun 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

Page 34: Activebarcode Developer English

Lotus Domino, LotusScriptBarcodes 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 PublicOption 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, 100End Sub

ActiveBarcode | © Lars Schenk & Frank Horn

Lotus Domino, LotusScript Barcodes in projects 30

Page 35: Activebarcode Developer English

Access 2010Barcodes 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 datafield. First launch Access and create a new database or open an already existing database inwhat 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

Page 36: Activebarcode Developer English

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 insidethe barcode with the right mouse button. A pop up menu will open.

Access 2010 Barcodes in reports 32

Page 37: Activebarcode Developer English

Select "ActiveBarcode−Object" and then "Properties...". The property dialog of ActiveBarcodewill open. Here you can modify the barcode as you like. For example you can change the type toany 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 thedatabase. 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

Page 38: Activebarcode Developer English

Watch the result:

The barcode control is bound to the data base field and shows the code of the current data setas EAN−128 barcode.

One last hint: A report is designed in a lower resolution that it is using while printing. So it maybe required that you create the barcode control with a much bigger font size than you wouldnormally 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

Page 39: Activebarcode Developer English

Access 2010 Barcodes in reports 35

Page 40: Activebarcode Developer English

Access 2010Barcodes 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. Firstlaunch Access and create a new database or open an already existing database in what youwant 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. Ifyou 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

Page 41: Activebarcode Developer English

A dialog will appear. Select "ActiveBarcode" here and click OK. Now the barcode object will beplaced 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 insidethe 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 anybarcode type supported by ActiveBarcode: For example: Code 25 Interleaved, Code 39, Code128, 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

Page 42: Activebarcode Developer English

Have a look for the entry "Control Source" and change it to "Productnumber". This is the databinding:

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 thecurrent data set as EAN−128 barcode.

Embedding and binding an ActiveBarcode control into reports is very similar.

Access 2010 Barcodes in Forms 38

Page 43: Activebarcode Developer English

One last hint: A report is designed in a lower resolution that it is using while printing. So it isrequired that you create the barcode control with a much bigger font size than you wouldnormally 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

Page 44: Activebarcode Developer English

Access 2007Barcodes 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 datafield. First launch Access and create a new database or open an already existing database inwhat 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

Page 45: Activebarcode Developer English

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 insidethe barcode with the right mouse button. A pop up menu will open.

Access 2007 Barcodes in reports 41

Page 46: Activebarcode Developer English

Select "ActiveBarcode−Object" and then "Properties...". The property dialog of ActiveBarcodewill open. Here you can modify the barcode as you like. For example you can change the type toany 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 thedatabase. 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

Page 47: Activebarcode Developer English

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

Page 48: Activebarcode Developer English

be required that you create the barcode control with a much bigger font size than you wouldnormally 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

Page 49: Activebarcode Developer English

Access 2007Barcodes 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. Firstlaunch Access and create a new database or open an already existing database in what you wantto 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. Ifyou 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. Selectthe "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

Page 50: Activebarcode Developer English

Select "ActiveBarcode" here and click OK. Now the barcode object will be placed in your form. Thiswill be a standard barcode of EAN−128 type. This is the default type. Now you can modify thisbarcode. You can change the type, text, colors etc. For this click inside the barcode with the rightmouse 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. Forexample 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" ofthe 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 databinding:

Access 2007 Barcodes in Forms 46

Page 51: Activebarcode Developer English

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 currentdata 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 isrequired that you create the barcode control with a much bigger font size than you would normallyuse. 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

Page 52: Activebarcode Developer English

Access 2000, XP, 2003Barcodes 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 datafield. First launch Access and create a new database or open an already existing database inwhat 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. Goto the menu "Insert" and select "ActiveX control":

A dialog will show up:

Access 2000, XP, 2003 Barcodes in reports 48

Page 53: Activebarcode Developer English

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 insidethe barcode with the right mouse button. A pop up menu will open.

Select "ActiveBarcode−Object" and then "Properties...". The property dialog of ActiveBarcodewill open. Here you can modify the barcode as you like. For example you can change the type toany 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

Page 54: Activebarcode Developer English

Next we bind the controls text property (the barcodes content) to the data field "Code" of thedatabase. 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 setas 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

Page 55: Activebarcode Developer English

be required that you create the barcode control with a much bigger font size than you wouldnormally 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

Page 56: Activebarcode Developer English

Access 2000, XP, 2003Barcodes in forms

To use this functionality you require the Enterprise Edition

Barcodes in an Access 2000, XP, 2003 database, formular orreport

Here we show you how to add a barcode into a Access database and bind it to a data field. Firstlaunch Access and create a new database or open an already existing database in what youwant 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. Ifyou 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

Page 57: Activebarcode Developer English

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 modifythis barcode. You can change the type, text, colors etc. For this click inside the barcode with theright mouse button. A pop up menu will open:

Select "ActiveBarcode−Object" and then "Properties...". The property dialog of ActiveBarcodewill 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

Page 58: Activebarcode Developer English

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 databinding:

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

Page 59: Activebarcode Developer English

The barcode control is bound to the data base field and shows the product number of thecurrent 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 isrequired that you create the barcode control with a much bigger font size than you wouldnormally 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

Page 60: Activebarcode Developer English

ActiveBarcode Control (OCX)

ActiveBarcode Control

Embed an ActiveBarcode Object (Control, OCX, ActiveX) into yourdocuments and projects. It's very flexible and can be automated.

Create barcode objects directly in your documents. You can edit andautomate the barcode directly inside the documents.

Developers use ActiveBarcode like a standard control. Place thebarcode control onto your application form and get barcode technology with a few clicks!

Programmers Reference:

Here you have an overview of allproperties, methods and events ofActiveBarcode. Please select one ofthe following chapters to getdescriptions on:

Properties• Methods• Events• The property dialog• Information about distributingthe ActiveX control (EnterpriseEdition, Developer licence)

Fullsizeview PDF

Download

Barcode types:

If you want more information of barcode types, go to Codes: Codabar, Code 25 Industrial, Code25 Interleaved, Code 39, Code 39 Extended, Code 93, Code 93 Extended, Code 128, DataMatrix, 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−Aand UPC−E

FAQ

If you have further questions or problems, please have a look at our FAQ.

ActiveBarcode | © Lars Schenk & Frank Horn

ActiveBarcode Control (OCX) 56

Page 61: Activebarcode Developer English

ActiveBarcode Control (OCX) 57

Page 62: Activebarcode Developer English

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

Show Text:If you swith this checkbox on, the human readable line will be created. If it's off, the humanreadable 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, Code93 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 MailSCC−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

Page 63: Activebarcode Developer English

ActiveBarcode | © Lars Schenk & Frank Horn

Property Dialog: General 59

Page 64: Activebarcode Developer English

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

Page 65: Activebarcode Developer English

Property Dialog: Fonts 61

Page 66: Activebarcode Developer English

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

Page 67: Activebarcode Developer English

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 ispainted 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. Theborder 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), setthis property to true.

The property dialog: | General | Fonts | Colors | Layout |

ActiveBarcode | © Lars Schenk & Frank Horn

Property Dialog: Layout 63

Page 68: Activebarcode Developer English

Property Dialog: Layout 64

Page 69: Activebarcode Developer English

ActiveBarcode Commandline Tool

General

You can use the ActiveBarcode command line tool to create barcode images files directly fromthe command line. E.g. use it in batch or script programs.

The commandline tool is included in the ActiveBarcode program package. When you setupActiveBarcode to your system, the commandline tool also will be installed. You can find the toolnamed barcodeimage.wsf in the folder you installed ActiveBarcode to. General this isc:\programs\ActiveBarcode.

An example: The following call of the tool will create a 400x200 pixels sized PNG image filenamed 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 imagefile 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 haveto 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

Page 70: Activebarcode Developer English

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=

Alignment1=left2=center3=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=sets the foreground colorhexadecimal RGB as RRGGBB

−foreground=000000(example is black)

−backcolor=sets the background colorhexadecimal RGB as RRGGBB

−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=

file type of image(valid values: bmp, jpg, png, tif, tga, gif,wbm, pbm, pgm, ppm, xpm, wmf, emf)Default: auto detect by extension offilename

−filetype=bmp

−colordepth=colordepth of the image file(valid values: 1,8,16,24,36)

−colordepth=24

−flags= flags for the image file −flags=0x80

−angle=rotates the image file(valid values: 0−359)

−angle=180

−transparent=background transparency(valid values: 0, 1, not implemented yet)

−transparent=1

−dpi=resolution in DPI for jpg, png, tif & bmpfiles

−dpi=300

−echo=

off: display no messageserrors: display only errorsverbose:display all messages and openbarcode in ImageView

−echo=off−echo=errors−echo=verbose

ActiveBarcode Commandline Tool 66

Page 71: Activebarcode Developer English

64bit Windows

If you want to use the barcodeimage.wsf program under Windows 64bit, you need to run thebarcodeimage.wsf in 32−bit, as the control is 32−bit too. On 64bit machines wsf files are runningin 64bit mode by default.

Have a look for a 32bit version of the cscript.exe or wscript.exe on your machine and then callthe script using the following commands:

cscript.exe barcodeimage.wsforwscript.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 tocreate barcodes dynamically in a OpenOffice document.We have created an example file for OpenOffice Calcthat creates barcodes from a list of numbers rightbeside the numbers in a sheet.

You can download this example file directly using thislink: ab_barcodelist.ods

Please have a look at the notes inside this document:You may have to edit the path of the command line toolinside the macro.

Example batch file

The ActiveBarcode software package contains a batch file to demonstrate the BarcodeImageprogram. This file has the name BarcodeImage−Demo.bat and has been installed by the setupinto the ActiveBarcode folder.

This batch file generates a demo_barcode_image* file for every image format in every supportedcolor depth.

Every possible combination is automatically generated and error messages are displayed onimpossible 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

Page 72: Activebarcode Developer English

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 variableASCII (128chars)

Modern 1D type of barcode. Hashighly copmpressed data. Very oftenused.

GS1−128,EAN−128,UCC−128

variableASCII (128chars)

This special form of the Code 128 isused for goods and palettes incommerce and industry. More thanone data field can be encoded usingApplication Identifiers.

EAN−13,GTIN−13

13 numeric 0−9The EAN code is primarily used insupermarkets to identify products atthe point of sales.

QR Code variable ASCII2D barcode for encoding mass textor data in only one code. Often usedfor Mobile−Tagging with cell phones.

Data Matrix variable ASCII2D barcode for encoding mass textor data in only one code.

GS1−DataMatrix

variableASCII (128chars)

This special form of the Data Matrixis used for goods and palettes incommerce and industry. More thanone data field can be encoded usingApplication Identifiers.

EAN−8,GTIN−8

8 numeric 0−9This is the short version of EAN−13for extremly small products.

PDF417 variable ASCII2D barcode for encoding mass textor data in only one code.

ISBN−13 13 numeric 0−9International Standard BookNumber. ISBN standard type since01. January 2007.

ISSN 8 numeric 0−9

International Standard SerialNumber. The ISSN serves the shortunmistakeable identification ofsequentially appearing publications,e.g., magazines.

ISMN 10 numeric 0−9The ISMN (Internationally StandardMusic Number) is used for markingprinted musical publications.

Barcode types 68

Page 73: Activebarcode Developer English

EAN−14,GTIN−14

14 numeric 0−9The EAN 14 code is used for tradedgoods

DUN−14 14 numeric 0−9Distribution Unit Number. Also havea look at EAN−14 and ITF−14.

SCC−14 14 numeric 0−9Shipping Container Symbol. Alsohave a look at EAN−14 and ITF−14.

ITF−14 14 numeric 0−9

The ITF−14 barcode is used tocreate the Shipping ContainerSymbol. This code is used to markcartons and palettes that areincluding goods with an EAN−13code.

EAN−18/NVE 18 numeric 0−9The EAN 18/NVE is used to displaythe Nummer der Versandeinheit(NVE).

SSCC−18 18 numeric 0−9

Serial Shipping Container Code. It isused throughout the supply chain asan identifier for item tracing andinternal control.

UPC−A,GTIN−12

12 numeric 0−9

The UPC A code is the standardversion of the UPC code and has 12digits. It is also called UPC 12 and isvery similar to the EAN code.

UPC−E 8 numeric 0−9This is the short version of UPC−Afor extremly small products.

Code 39 variableA−Z, 0−9, 5special chars

Also known as Code 3 of 9. Oftenused type that is self checking.

Code 39Extended

variableASCII (127chars)

Also known as Code 3 of 9Extended. Extension of Code 39.

Code 25 variable numeric 0−9Also known as Code 2 of 5 andCode 25 Industrial. Rather old codefor industrial use.

Code 25Interleaved

variable numeric 0−9Also known as Code 2 of 5Interleaved. Industrial use.

JAN 13 numeric 0−9Japanese Article Numbering. It'sprimarily used in supermarkets toidentify product at the point of sales.

Barcode types 69

Page 74: Activebarcode Developer English

EAN−5 5 numeric 0−9AddOn code. For example for books(see ISBN).

EAN−2 2 numeric 0−9AddOn code. For example formagazines.

EAN−99 13 numeric 0−9

"EAN−99 is a special form of theEAN−13, which just starts with""99"". EAN 99 is used as anin−store coupon."

EAN−Velocity 8 numeric 0−9

EAN−Velocity is a special form of theEAN−8. This code is internally usedby dealers for products that have noEAN−13 or EAN−8 code from theproducer.

ISBN−13 Dual 13 numeric 0−9

International Standard BookNumber. ISBN transitional type from01. January 2006 to 31. December2006.

ISBN−10 13 numeric 0−9International Standard BookNumber. ISBN standard type until31. December 2005.

Codabar variable0−9, 6 specialcharacters

Old barcode type. Often used inmedicine in the past.

Code 93 variableA−Z, 0−9, 5special chars

Same characterset as Code 39 butmore compacted code that requiresless space.

Code 93Extended

variableASCII (127chars)

Same characterset as Code 39Extended but more compacted codethat requires less space.

PZN7 7 numeric 0−9Pharmazentralnummer für medicine.Special form of Code 39.

PZN8 7 numeric 0−9Pharmazentralnummer für medicine.Special form of Code 39.

Leitcode 14 numeric 0−9The Leitcode is used by DeutschenPost/DHL.

Identcode 12 numeric 0−9The Identcode is used by DeutschenPost/DHL.

Barcode types 70

Page 75: Activebarcode Developer English

Code 128A variable

Uppercaseletters andcontrolcharacters

Subcode of Code 128. This type isnormally not used for itself. UseCode 128 or EAN 128 instead.

Code 128B variableUpper− andlowercaseletters

Subcode of Code 128. This type isnormally not used for itself. UseCode 128 or EAN 128 instead.

Code 128C variable numeric 0−9Subcode of Code 128. This type isnormally not used for itself. UseCode 128 or EAN 128 instead.

MSI Plessey variable numeric 0−9Old code typ. Was used for goodsand books in the past.

PostNet variable numeric 0−9This code us used to improve thespeed of sorting and delivering ofmail.

Royal Mail variable A−Z, 0−9The Royal Mail 4 State CustomerCode (RM4SCC) was created forautomated 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

Page 76: Activebarcode Developer English

OCX: Properties

Properties of des Controls

Name Type Description read−only

Text charText contains the content of the barcode.General without check digit.

ShowText bool

TRUE: The barcode has a human readabletext. (default)FALSE: The barcode is displayed withoutthe text.

Type long Specifies the barcode type. −

Rotate longRotate contains the orientation of thedisplayed barcode in degreess(0,90,180,270).

Alignment AlignConstants

Alignment sets the alignment (on the left,on the right, centered) of the barcode. Youcan pass AlignLeft, AlignCenter orAlignRight.

TypeName char Contains the name of the barcode type. −

IsValid boolReturns TRUE if the barcode is valid. If it'sinvalid, the text cannot be coded with theselected barcode type.

read−only

IsSizeOk bool

Returns TRUE if the barcode is displayedcorrect. If it's FALSE, the barcode cannotbe displayed because the controlsdimensions are too small to display thebarcode correct.

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 fontobjectSpecifies the font by name, style, effectsand the size for the text line.

Version char Returns the controls version number. read−only

BorderHeight long

BorderHeight sets the height of the borderabove and under the barcode in pixels.The border is painted in the currentbackground color (BackColor).

BorderWidth long

BorderWidth sets the width of the borderon the left and the right of the barcode inpixels. The border is painted in the currentbackground color (BackColor).

MaxBorderHeight longMaxBorderHeight returns the maximumpossible value of BorderHeight.

read−only

MaxBorderWidth longMaxBorderWidth returns the maximumpossible value of BorderWidth.

read−only

NotchHeightInPercent long Sets the length of the notches in percent. −

PrintFix bool If you have the problem that the bars of thecode are too thin when printing (i.e. with

OCX: Properties 72

Page 77: Activebarcode Developer English

Excel), set this property to true.

AutoType bool

This property should not be used. It's onlyimplemented for compatibility purposes toold versions. ActiveBarcde tries to detectthe barcode type automatically.

ActiveBarcode | © Lars Schenk & Frank Horn

OCX: Properties 73

Page 78: Activebarcode Developer English

OCX: Methods

Methods of the Control

Name Parameter Description

CopyToClipboard : boolCopies the barcode in meta graphicformat to the clipboard. Returns TRUE ifsuccessful.

CopyToClipboardBySize(Width: Integer, Height:Integer): Bool

Copies the barcode in meta graphicformat to the clipboard. The size of thebarcode is specified by the argumentswidth and height. Returns TRUE ifsuccessful.

CreatePictureBySize(Width: Integer, Height:Integer): Bool

Allows a custom sized Picture propertyto be handled. The size of the barcodepicture is specified by the argumentswidth and height. Returns TRUE ifsuccessful.

SaveAs(path: WideString):Smallint

Saves the current barcode as image file(BMP, JPEG, PNG, TIFF, Targa, GIF,WMF, EMF, PBM, PGM, PPM, WBMPand XPM). The image size is the currentsize of the control. The image file typeused is defined by the extension of thefile name (e.g. BMP for a WindowsBitmap).

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, WBMPand XPM). The image size is specifiedby the parameters width and height. Theimage file type used is defined by theextension of the file name (e.g. BMP fora Windows Bitmap).

SaveAsBySizeExtended

(path: WideString, Width:Integer, Height: Integer,Format: Integer,ColorDepth: Integer,Transparent: Integer,Flags: Integer, Angle:Integer, DPI: Integer):Smallint

Extended version of the SaveAsBySizeMethod.

SetDemoText −Sets the property Text to a valid defaultvalue. Use this for demonstration or testpurposes to get a valid code.

BinaryWriteAsPNGBySize(Width: Integer, Height:Integer): OleVariant

Returns the current barcode in binaryPNG image format. The size is specifiedby Width and Height parameters. Thismethod is only available in theEnterprise Edition.

BinaryWriteAsPNG : OleVariant Returns the current barcode in currentsize binary PNG image format. Thismethod is only available in the

OCX: Methods 74

Page 79: Activebarcode Developer English

Enterprise Edition.

AboutBox −Opens the info dialog of ActiveBarcodeand shows Version and other details.

SaveAsPNG(path: WideString):Smallint

Saves the current barcode as PNGimage file. The image size is the currentsize of the control.

SaveAsPNGBySize(path: WideString, Width:Integer, Height: Integer):Smallint

Saves the current barcode as PNGimage file. The image size is specifiedby the paramters width and height.

ActiveBarcode | © Lars Schenk & Frank Horn

OCX: Methods 75

Page 80: Activebarcode Developer English

OCX: Events

Events of the Control

Name Parameter Description

TypeChange BarcodeType:longIs triggered when the barcode type is changed. Theproperty Type is passed and can be used.

TextChange Text:charIs triggered when the barcode text is changed. Theproperty Text is passed and can be used.

ShowTextChange ShowText:boolIs triggered when the display of the barcode textenabled or disabled. The property ShowText is passedand can be used.

AutoTypeChange AutoType:boolIs triggered when the Autotype option is enabled ordisabled. The property Autotype is passed and can beused.

PrintFixChange PrintFix:boolIs triggered when the PrintFix option is enabled ordisabled. The property PrintFix is passed and can beused.

ActiveBarcode | © Lars Schenk & Frank Horn

OCX: Events 76

Page 81: Activebarcode Developer English

Property: Text

Text char

Text contains the content of the barcode. General without check digit.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: Text 77

Page 82: Activebarcode Developer English

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

Page 83: Activebarcode Developer English

Property: Type

Type long

Specifies the barcode type.

value long Code Name0 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

7Code 25Interleaved

CODE25I

8 Codabar CODABAR

9Code 25Industrial

CODE25

10Code 39Extended

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

22Code 93Extended

CODE93E

23 PZN7 CODEPZN8

24 Identcode CODEINDENTCODE

25 Leitcode CODELEITCODE

26Code 39Checksum

CODE39CHECKSUM

27Code 39ExtendedChecksum

CODE39ECHECKSUM

28 EAN/UCC 128 AI CODEEAN128AI

29 EAN 14 CODEEAN14

30 ITF−14 CODEITF14

31 EAN−18/NVE CODEEAN18

Property: Type 79

Page 84: Activebarcode Developer English

32 SSCC−18 CODESSCC18

33CodabarChecksum

CODABARCHECKSUM

34Code 25InterleavedChecksum

CODE25ICHECKSUM

35Code 25IndustrialChecksum

CODE25CHECKSUM

36 PDF417 CODEPDF417

37 DataMatrix CODEDATAMATRIX

38 ISBN−13 CODEISBN13

39 ISBN−13 Dual CODEISBN13DUAL

40 ISSN CODEISSN

41 ISMN CODEISMN

42DataMatrixSquare

CODEDATAMATRIXSQUARE

43DataMatrixRectangular

CODEDATAMATRIXRECTANGULAR

44DataMatrix10x10

CODEDATAMATRIX10X10

45DataMatrix12x12

CODEDATAMATRIX12X12

46 DataMatrix 8x18 CODEDATAMATRIX8X18

47DataMatrix14x14

CODEDATAMATRIX14X14

48 DataMatrix 8x32 CODEDATAMATRIX8X32

49DataMatrix16x16

CODEDATAMATRIX16X16

50DataMatrix12x26

CODEDATAMATRIX12X26

51DataMatrix18x18

CODEDATAMATRIX18X18

52DataMatrix20x20

CODEDATAMATRIX20X20

53DataMatrix12x36

CODEDATAMATRIX12X36

54DataMatrix22x22

CODEDATAMATRIX22X22

55DataMatrix16x36

CODEDATAMATRIX16X36

56DataMatrix24x24

CODEDATAMATRIX24X24

57DataMatrix26x26

CODEDATAMATRIX26X26

58DataMatrix16x48

CODEDATAMATRIX16X48

59DataMatrix32x32

CODEDATAMATRIX32X32

Property: Type 80

Page 85: Activebarcode Developer English

60DataMatrix36x36

CODEDATAMATRIX36X36

61DataMatrix40x40

CODEDATAMATRIX40X40

62DataMatrix44x44

CODEDATAMATRIX44X44

63DataMatrix48x48

CODEDATAMATRIX48X48

64DataMatrix52x52

CODEDATAMATRIX52X52

65DataMatrix64x64

CODEDATAMATRIX64X64

66DataMatrix72x72

CODEDATAMATRIX72X72

67DataMatrix80x80

CODEDATAMATRIX80X80

68DataMatrix88x88

CODEDATAMATRIX88X88

69DataMatrix96x96

CODEDATAMATRIX96X96

70DataMatrix104x104

CODEDATAMATRIX104X104

71DataMatrix120x120

CODEDATAMATRIX120X120

72DataMatrix132x132

CODEDATAMATRIX132X132

73DataMatrix144x144

CODEDATAMATRIX144X144

74 GS1−Data Matrix CODEGS1DATAMATRIX

75GS1−Data MatrixSquare

CODEGS1DATAMATRIXSQUARE

76GS1−Data MatrixRectangular

CODEGS1DATAMATRIXRECTANGULAR

77GS1−Data Matrix10x10

CODEGS1DATAMATRIX10X10

78GS1−Data Matrix12x12

CODEGS1DATAMATRIX12X12

79GS1−Data Matrix8x18

CODEGS1DATAMATRIX8X18

80GS1−Data Matrix14x14

CODEGS1DATAMATRIX14X14

81GS1−Data Matrix8x32

CODEGS1DATAMATRIX8X32

82GS1−Data Matrix16x16

CODEGS1DATAMATRIX16X16

83GS1−Data Matrix12x26

CODEGS1DATAMATRIX12X26

84GS1−Data Matrix18x18

CODEGS1DATAMATRIX18X18

85 CODEGS1DATAMATRIX20X20

Property: Type 81

Page 86: Activebarcode Developer English

GS1−Data Matrix20x20

86GS1−Data Matrix12x36

CODEGS1DATAMATRIX12X36

87GS1−Data Matrix22x22

CODEGS1DATAMATRIX22X22

88GS1−Data Matrix16x36

CODEGS1DATAMATRIX16X36

89GS1−Data Matrix24x24

CODEGS1DATAMATRIX24X24

90GS1−Data Matrix26x26

CODEGS1DATAMATRIX26X26

91GS1−Data Matrix16x48

CODEGS1DATAMATRIX16X48

92GS1−Data Matrix32x32

CODEGS1DATAMATRIX32X32

93GS1−Data Matrix36x36

CODEGS1DATAMATRIX36X36

94GS1−Data Matrix40x40

CODEGS1DATAMATRIX40X40

95GS1−Data Matrix44x44

CODEGS1DATAMATRIX44X44

96GS1−Data Matrix48x48

CODEGS1DATAMATRIX48X48

97GS1−Data Matrix52x52

CODEGS1DATAMATRIX52X52

98GS1−Data Matrix64x64

CODEGS1DATAMATRIX64X64

99 None CODENONE

100GS1−Data Matrix72x72

CODEGS1DATAMATRIX72X72

101GS1−Data Matrix80x80

CODEGS1DATAMATRIX80X80

102GS1−Data Matrix88x88

CODEGS1DATAMATRIX88X88

103GS1−Data Matrix96x96

CODEGS1DATAMATRIX96X96

104GS1−Data Matrix104x104

CODEGS1DATAMATRIX104X104

105GS1−Data Matrix120x120

CODEGS1DATAMATRIX120X120

106GS1−Data Matrix132x132

CODEGS1DATAMATRIX132X132

107GS1−Data Matrix144x144

CODEGS1DATAMATRIX144X144

108 GS−128 CODEGS1128

109 GTIN−8 CODEGTIN8

110 GTIN−12 CODEGTIN12

111 GTIN−13 CODEGTIN13

112 GTIN−14 CODEGTIN14

Property: Type 82

Page 87: Activebarcode Developer English

113 QR Code CODEQRCODE

114QR Code ECCLevel L

CODEQRCODEECCLEVELL

115QR Code ECCLevel M

CODEQRCODEECCLEVELM

116QR Code ECCLevel Q

CODEQRCODEECCLEVELQ

117QR Code ECCLevel H

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

138QR Code101x101

CODEQRCODE101X101

139QR Code105x105

CODEQRCODE105X105

140QR Code109x109

CODEQRCODE109X109

141QR Code113x113

CODEQRCODE113X113

142QR Code117x117

CODEQRCODE117X117

143QR Code121x121

CODEQRCODE121X121

144QR Code125x125

CODEQRCODE125X125

145QR Code129x129

CODEQRCODE129X129

146QR Code133x133

CODEQRCODE133X133

147 CODEQRCODE137X137

Property: Type 83

Page 88: Activebarcode Developer English

QR Code137x137

148QR Code141x141

CODEQRCODE141X141

149QR Code145x145

CODEQRCODE145X145

150QR Code149x149

CODEQRCODE149X149

151QR Code153x153

CODEQRCODE153X153

152QR Code157x157

CODEQRCODE157X157

153QR Code161x161

CODEQRCODE161X161

154QR Code165x165

CODEQRCODE165X165

155QR Code169x169

CODEQRCODE169X169

156QR Code173x173

CODEQRCODE173X173

157QR Code177x177

CODEQRCODE177X177

158 PZN8 CODEPZN8

ActiveBarcode | © Lars Schenk & Frank Horn

Property: Type 84

Page 89: Activebarcode Developer English

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

Page 90: Activebarcode Developer English

Property: Alignment

Alignment AlignConstants

Alignment sets the alignment (on the left, on the right, centered) of the barcode. You can passAlignLeft, 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

Page 91: Activebarcode Developer English

Property: TypeName

TypeName char

Contains the name of the barcode type.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: TypeName 87

Page 92: Activebarcode Developer English

Property: IsValid

IsValid bool read−only

Returns TRUE if the barcode is valid. If it's invalid, the text cannot be coded with the selectedbarcode type.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: IsValid 88

Page 93: Activebarcode Developer English

Property: IsSizeOk

IsSizeOk bool read−only

Returns TRUE if the barcode is displayed correct. If it's FALSE, the barcode cannot bedisplayed because the controls dimensions are too small to display the barcode correct.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: IsSizeOk 89

Page 94: Activebarcode Developer English

Property: Checksum

Checksum long read−only

Returns the check digit.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: Checksum 90

Page 95: Activebarcode Developer English

Property: Picture

Picture pictureobject read−only

Returns the barcode picture.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: Picture 91

Page 96: Activebarcode Developer English

Property: BackColor

BackColor OLE_Color

Background color of the barcode.

Examples:

White BackColor Green BackColor

ActiveBarcode | © Lars Schenk & Frank Horn

Property: BackColor 92

Page 97: Activebarcode Developer English

Property: ForeColor

ForeColor OLE_Color

Foreground color of the barcode.

Examples:

Black Forecolor Green Forecolor

ActiveBarcode | © Lars Schenk & Frank Horn

Property: ForeColor 93

Page 98: Activebarcode Developer English

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 = TrueBarcode1.Font.Italic = TrueBarcode1.Font.Underline = TrueBarcode1.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

Page 99: Activebarcode Developer English

Property: Version

Version char read−only

Returns the controls version number.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: Version 95

Page 100: Activebarcode Developer English

Property: BorderHeight

BorderHeight long

BorderHeight sets the height of the border above and under the barcode in pixels. The border ispainted in the current background color (BackColor).

Examples:

BorderHeight=4 BorderHeight=20

ActiveBarcode | © Lars Schenk & Frank Horn

Property: BorderHeight 96

Page 101: Activebarcode Developer English

Property: BorderWidth

BorderWidth long

BorderWidth sets the width of the border on the left and the right of the barcode in pixels. Theborder is painted in the current background color (BackColor).

ActiveBarcode | © Lars Schenk & Frank Horn

Property: BorderWidth 97

Page 102: Activebarcode Developer English

Property: MaxBorderHeight

MaxBorderHeight long read−only

MaxBorderHeight returns the maximum possible value of BorderHeight.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: MaxBorderHeight 98

Page 103: Activebarcode Developer English

Property: MaxBorderWidth

MaxBorderWidth long read−only

MaxBorderWidth returns the maximum possible value of BorderWidth.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: MaxBorderWidth 99

Page 104: Activebarcode Developer English

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

Page 105: Activebarcode Developer English

Property: PrintFix

PrintFix bool

If you have the problem that the bars of the code are too thin when printing (i.e. with Excel), setthis property to true.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: PrintFix 101

Page 106: Activebarcode Developer English

Property: AutoType

AutoType bool

This property should not be used. It's only implemented for compatibility purposes to oldversions. ActiveBarcde tries to detect the barcode type automatically.

ActiveBarcode | © Lars Schenk & Frank Horn

Property: AutoType 102

Page 107: Activebarcode Developer English

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

Page 108: Activebarcode Developer English

Method: CopyToClipboardBySize

CopyToClipboardBySize (Width: Integer, Height: Integer):Bool

Copies the barcode in meta graphic format to the clipboard. The size of the barcode is specifiedby the arguments width and height. Returns TRUE if successful.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: CopyToClipboardBySize 104

Page 109: Activebarcode Developer English

Method: CreatePictureBySize

CreatePictureBySize (Width: Integer, Height: Integer): Bool

Allows a custom sized Picture property to be handled. The size of the barcode picture isspecified by the arguments width and height. Returns TRUE if successful.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: CreatePictureBySize 105

Page 110: Activebarcode Developer English

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. Theimage file type used is defined by the extension of the file name (e.g. BMP for a WindowsBitmap).

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

Page 111: Activebarcode Developer English

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 andheight. The image file type used is defined by the extension of the file name (e.g. BMP for aWindows 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

Page 112: Activebarcode Developer English

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 theautomatic 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 −1to 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 overrulethis 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 inthe 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 format3 : Colordepth/angle combination not possible4 : Filetype not supported5 : Low memory6 : Low memory7 : Low memory

ActiveBarcode | © Lars Schenk & Frank Horn

Method: SaveAsBySizeExtended 108

Page 113: Activebarcode Developer English

Method: SaveAsBySizeExtended 109

Page 114: Activebarcode Developer English

ActiveBarcode Control: Image file options

Supported image file formats

The functions SaveAs, SaveAsBySize and SaveAsBySizeExtended of the ActiveBarcodeControl support different image formats and color depths:

Image format Extension Format 1−bit s/w 8−bit 16−bit 24−bit 32−bitWindows Bitmap BMP 0 yes yes yes yes default

JPEG JPG, JPEG 2 − gray − default −

Portable NetworkGraphic

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 MetafileFormat

WMF 101 − − − default −

Enhanced MetafileFormat

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 orwhen you set the color depth to zero when using the function SaveAsBySizeExtended.

Color depths for image files

Supported color depths are:

colordepth Description1 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

Page 115: Activebarcode Developer English

Supported flags for image files

You can use the following flags when saving image files:

Image format Flag Description

BMP 0x1Saves the bitmap as RLE (Run LengthEncoded)

JPG, JPEG

0x800x1000x2000x4000x800

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), ifyou are using the SaveAsBySizeExtended method.

ActiveBarcode | © Lars Schenk & Frank Horn

ActiveBarcode Control: Image file options 111

Page 116: Activebarcode Developer English

Method: SetDemoText

SetDemoText

Sets the property Text to a valid default value. Use this for demonstration or test purposes to geta valid code.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: SetDemoText 112

Page 117: Activebarcode Developer English

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

Page 118: Activebarcode Developer English

Method: BinaryWriteAsPNGBySize

BinaryWriteAsPNGBySize (Width: Integer, Height: Integer):OleVariant

Returns the current barcode in binary PNG image format. The size is specified by Width andHeight parameters. This method is only available in the Enterprise Edition.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: BinaryWriteAsPNGBySize 114

Page 119: Activebarcode Developer English

Method: BinaryWriteAsPNG

BinaryWriteAsPNG : OleVariant

Returns the current barcode in current size binary PNG image format. This method is onlyavailable in the Enterprise Edition.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: BinaryWriteAsPNG 115

Page 120: Activebarcode Developer English

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 ofcompatibility. You should use the function SaveAs instead which supports more file formats.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: SaveAsPNG 116

Page 121: Activebarcode Developer English

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 paramterswidth and height.

Tip:This function has become outdated and is contained in ActiveBarcode only for reasons ofcompatibility. You should use the function SaveAsBySize instead which supports more fileformats.

ActiveBarcode | © Lars Schenk & Frank Horn

Method: SaveAsPNGBySize 117

Page 122: Activebarcode Developer English

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

Page 123: Activebarcode Developer English

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

Page 124: Activebarcode Developer English

Event: ShowTextChange

ShowTextChange (ShowText:bool)

Is triggered when the display of the barcode text enabled or disabled. The property ShowText ispassed and can be used.

ActiveBarcode | © Lars Schenk & Frank Horn

Event: ShowTextChange 120

Page 125: Activebarcode Developer English

Event: AutoTypeChange

AutoTypeChange (AutoType:bool)

Is triggered when the Autotype option is enabled or disabled. The property Autotype is passedand can be used.

ActiveBarcode | © Lars Schenk & Frank Horn

Event: AutoTypeChange 121

Page 126: Activebarcode Developer English

Event: PrintFixChange

PrintFixChange (PrintFix:bool)

Is triggered when the PrintFix option is enabled or disabled. The property PrintFix is passed andcan be used.

ActiveBarcode | © Lars Schenk & Frank Horn

Event: PrintFixChange 122

Page 127: Activebarcode Developer English

Information for developersTo use this functionality you require the Enterprise Edition

Distribution of the ActiveX Control with your own programse.g. developed with C++, C#, Visual Basic, Delphi etc.

The following information is only for owners of the Enterprise Edition. If you own a StandardEdition, you have no license to distribute any files.

If you create an application with the ActiveBarcode ActiveX Control (OCX) and want todistribute, 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 youdistribute other files, as for example the ActiveBarcode Application or a license file (*.lic), this isan offense against the license. Please always be sure, that you only distribute the files you areallowed to.

The ActiveX Control (OCX) must be registered in the system before it can be used. You can dothis from the command prompt with the following command:

regsvr32 activebarcode.ocx

Open the command prompt with administrator rights, otherwise the registration in the systemcan 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 exampleInno setup) can do this registration during the installation, so that the above manual registrationis not necessary.

Please note that you have no permission to distribute an application that's exclusive purpose it isto create barcodes.

Required DLL's

ActiveBarcode required some system DLL's to run properly. If you run the setup ofActiveBarcode 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 thetarget system are available at least in the following versions:

mfc42.dll − 4.21.0.7022msvcrt.dll − 5.0.4058.1olepro32.dll − 5.0.0.7022

Current Windows versions already carry this or newer versions and there is no need to updatethem. Our experiences point that there is no need to update these DLL's in Windows 98SE orabove.

ActiveBarcode | © Lars Schenk & Frank Horn

Information for developers 123