FAQ: Product Licensing, Applying the License Key
SDK: Licensing Within Program Code
Choose the instructions for your SDK. TBarCode SDK and TFORMer SDK V9 use different licensing APIs and license data.
TBarCode SDK: Licensing
Apply the license before generating the first barcode, normally at application startup. Use the licensee, license type, count, key and product variant exactly as supplied by TEC-IT. The values below are placeholders, not valid license data.
Create an instance before licensing an ActiveX/COM control. Load the native library before calling its licensing function.
TBarCode .NET (C#)
using TECIT.TBarCode;
var barcode = new Barcode();
barcode.License("YourLicensee", LicenseType.DeveloperOrWeb, 1,
"YourKey", TBarCodeProduct.Barcode2D);
TBarCode DLL (C/C++)
BCLicenseMe("YourLicensee", eLicKindDeveloper, 1,
"YourKey", eLicProd2D);
// Enumerations: TECBCEnum.h
TBarCode OCX (VB)
Private Sub Form_Load()
TBarCode11.LicenseMe "Mem: Licensee Info", _
eLicKindDeveloper, 1, "YourKey", eLicProd2D
End Sub
INI file and server licenses
TBarCode .NET supports INI-file licensing, including web licenses. Whether INI licensing is appropriate depends on the license type. For developer licenses, use programmatic licensing and protect the license data. Request a suitable barcode.ini file from support.
API references
Microsoft Excel - Licensing During Open
Licensing happens during startup of the document which contains the ActiveX® Control.
- Open the Microsoft VBA editor with Alt+F11.
- In the Project Explorer select This Workbook.
- Now enter the following code as for the Workbook-Open Event (sample for TBarCode OCX V11):
Private Sub Workbook_Open()
Dim tbc As TBarCode11
Set tbc = CreateObject ("TBarCode11.TBarCode11")
tbc.LicenseMe "Mem:Licensee", eLicKindDeveloper, 1, "Key", TBarCode11Lib.eLicProd1D
Set tbc = Nothing
End Sub
We recommend to password protect your VBA code in the project property window.
Microsoft Access - Licensing with Autoexec Macro
Below we show you how to license at startup of the database (sample for TBarCode OCX V11). Create a new Module with the following function (in Microsoft VBA Editor):
Public Function LicenseTBarCode() Dim TB As New TBarCode11 TB.LicenseMe "Mem:Licensee", eLicKindDeveloper, 1, "Key", TBarCode11Lib.eLicProd1D Set TB = Nothing End Function
Create a new Macro named "Autoexec" with the following settings:
Action = RunCode Function Name = LicenseTBarCode()
Licensing TBarCode OCX in Microsoft InfoPath (JavaScript)
Please use this code to license TBarCode OCX V11 in the OnLoad event of your InfoPath document (through JavaScript):
function XDocument::OnLoad(eventObj)
{
var tbc = new ActiveXObject("TBarCode11.TBarCode11")
tbc.LicenseMe("Licensee", 2, 1, "YourKey", 2023 )
}
TFORMer SDK: Licensing
TFORMer SDK V9 uses seven signed license fields rather than the older license-key format. Apply the license before the first output operation, such as Print. Copy every value exactly from the license email. The examples contain placeholders and illustrate a server license; use the license kind and count actually issued to you.
License fields
| License fields | Meaning |
|---|---|
| Activation Key | Activation code from the license email or license.tec-it.com |
| Licensee | Exact licensee name |
| License Kind | Issued license type |
| License Count | Number of licenses |
| Options | Issued license options, e.g. noSID |
| Expiration Date | Expiration date in YYYYMMDD format |
| Signature | Signature of the license data (Base64) |
Three ways to apply the license
License accepts all seven fields individually. LicenseBase64 accepts the complete encoded license data as one string, also suitable for configuration variables or containers. This value is in the OASLicense field of the INI file. LicenseFile loads a TFORMer.ini file supplied by TEC-IT.
Keep license data confidential. For applications distributed to customers, license through code (individual fields or Base64) and protect the license data. Never distribute your INI file.
TFORMer .NET (C#)
using TECIT.TFORMer;
TFORMer.License(
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // Activation Key
"Your Company, AT-4400", // Licensee
LicenseKind.Server, // License Kind
2, // License Count
"noSID", // Options
"20270708", // Expiration Date
"BjAyLjAxOgia..."); // Signature
// Alternative: complete encoded license data
TFORMer.LicenseBase64("BjAyLjAxOgia...");
// Alternative: license file
TFORMer.LicenseFile(@"C:\ProgramData\TEC-IT\TFORMer\9\TFORMer.ini");
TFORMer DLL / Shared Library (C/C++)
TFormer_License("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Your Company, AT-4400", LICKIND_SERVER, 2, "noSID",
"20270708", "BjAyLjAxOgia...");
// Alternatives
TFormer_LicenseBase64("BjAyLjAxOgia...");
TFormer_LicenseFile("/usr/local/share/TFORMer9/TFORMer.ini");
TFORMer COM (VB)
Dim objTFormer As New TFORMer
objTFormer.License "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", _
"Your Company, AT-4400", LicenseKind_Server, 2, "noSID", _
"20270708", "BjAyLjAxOgia..."
TFPrint command line
The -L parameter accepts the seven fields in the stated order, b64: followed by the Base64 data, or file: followed by the INI path. Quote values containing spaces. The license-kind keywords are Single, Workgroup, Office, Site, Developer and Server. If an INI file already licenses the installation, -L can be omitted.
tfprint -L ActivationKey Licensee LicenseKind LicenseCount Options ExpirationDate Signature
tfprint -L b64:BASE64_DATA
tfprint -L file:PATH_TO_INI
tfprint -L AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA "Your Company, AT-4400" Server 2 noSID 20270708 BjAyLjAxOgia... -f Label.tfr -o Label.pdf
INI file: automatic lookup
TFORMer looks for TFORMer.ini in this order:
- Application module directory
- TFORMer runtime directory: C:\Program Files\TEC-IT\TFORMer9 SDK\Bin on Windows, /usr/local/share/TFORMer9 on Linux/UNIX
- ProgramData directory: C:\ProgramData\TEC-IT\TFORMer\9 on Windows
With custom installations, use the corresponding application/runtime directory. LicenseFile can also specify the file explicitly.
Missing license data or need an INI file? Contact support@tec-it.com.