General

Native C API

General functions which are mandatory for most applications.

Calling Convention

The Native C API functions and streaming callback are declared with __stdcall. On 32-bit Windows, match this calling convention when implementing a callback or declaring a foreign-language binding. On Linux/UNIX, the SDK headers define __stdcall as empty.

NameKindPurpose
LICKIND_WORKSTATIONdefine Workstation license.
LICKIND_SITEdefine Site license.
LICKIND_DEVELOPERdefine Developer license.
LICKIND_OFFICEdefine Office license.
LICKIND_WORKGROUPdefine Workgroup license.
LICKIND_SERVERdefine Server license.
EVarTypeenum Defines the type of a DataField.
EPrinterTypeenum This enumeration specifies the type of output generated by TFORMer SDK.
EVarUsageenum Describes the usage of a DataField within a FormLayout.
ETFDataFormatenum Describes the desired format for requested data (e.g.
TFormer_Initfunction Allocates and initializes internal memory.
TFormer_Exitfunction Frees system resources previously allocated with TFormer_Init.
TFormer_Licensefunction Licenses this TFORMer SDK instance via the given license data (provided by TEC-IT).
TFormer_LicenseBase64function Licenses this TFORMer SDK instance via the given base64 string (provided by TEC-IT).
TFormer_LicenseFilefunction Licenses this TFORMer SDK instance via the given license file (provided by TEC-IT).
ERRCODEdefine Define the type for the error codes.
ErrOkdefine Define error code for "no error" (ErrOk, 0).
ERR_TF_LICENSE_EXPIREDdefine Error code for "TFORMer license is expired".

License Types

The license types for the TFORMer SDK (see TFormer_License).

LICKIND_WORKSTATION

#define LICKIND_WORKSTATION 1

Workstation license.

Supports exactly one installation on a machine which is identified via the system-id.

LICKIND_SITE

#define LICKIND_SITE 2

Site license.

Supports a certain number of installations or users within one facility or site (located at a single postal address).

LICKIND_DEVELOPER

#define LICKIND_DEVELOPER 3

Developer license.

Supports the use of TFORMer SDK in client-applications for a certain number of redistributions.

LICKIND_OFFICE

#define LICKIND_OFFICE 4

Office license.

Supports a certain number of installations or users within one facility or site (located at a single postal address).

LICKIND_WORKGROUP

#define LICKIND_WORKGROUP 5

Workgroup license.

Supports a certain number of installations or users within one facility or site (located at a single postal address).

LICKIND_SERVER

#define LICKIND_SERVER 6

Server license.

Supports a certain number of total users for a (web-)server based installation.

EVarType

enum EVarType

Defines the type of a DataField.

Overview

A DataField is a place-holder for dynamic content in a FormLayout. One FormLayout can use an arbitrary number of DataFields (0..n). TFORMer Designer requires that a DataField is defined before it can be used. This definition takes place directly in the FormLayout (in the case of a stand-alone FormLayout) or in a user-defined Project (or the GlobalProject ) of a Repository.

A DataField can be printed as text, as bar-code or may be used to provide the filename for image elements in the FormLayout. Besides this, a DataField can be used in element expressions and printing conditions.

Data Type

The type of a DataField influences its use in expressions within a FormLayout and the conversion method when reading a DataField from a JobData. 3 different data types are supported:

Numeric conversion is permissive and can ignore non-numeric characters. Validate numeric strings in your application if strict format checking is required.

Naming Conventions

A DataField name must begin with an ASCII letter (A to Z or a to z) or an underscore. The remaining characters may be ASCII letters, digits (0 to 9) or underscores. Spaces, tabs, hyphens, accented letters and other special characters are not allowed. See Naming Rules for naming rules and examples.

Usually DataField names are not suitable for representing them to end-users. Refer to additional properties like Caption, Description, Comment and DisplayOrder for such purposes.

Data Field Values

For printing a FormLayout it is required to provide the DataField values via JobData. When a JobData is used to pass data to TFORMer SDK and a DataField is not set by this JobData the value of the DataField will be an empty string ("") or 0 (see also TFormer_SetReuseValues).

Data Field Default Values

The DefaultValue is the standard value of a DataField. The DefaultValue is only used by TFORMer Designer.

Validating DataFields

A validation rule is an expression that checks whether a DataField value meets a condition. Define the rule and its validation message in the FormLayout or Repository with TFORMer Designer (recommended). The native C API applies these stored definitions; it does not provide functions for editing validation rules or messages.

Validation rules are evaluated when records are read during output generation. If a rule is violated, the SDK reports an error and includes any configured validation message in the additional error information. Check the return code of TFormer_Print or TFormer_PrintToStream, then use TFormer_GetLastErrorInformation to retrieve the additional error information.

TFORMer Designer displays an error message for invalid data.

DataField Enumeration

To iterate through the available DataField objects, use TFormer_GetFirstProjectVarIt and TFormer_GetNextProjectVarIt.

To find a particular DataField, compare each name returned by TFormer_ProjectVarItGetName with the required name. Release the iterator with TFormer_FreeProjectVarIt after use.

If you want to know, whether the returned DataField is actually used in the FormLayout use the method TFormer_ProjectVarItGetUsage.

To determine if a specific DataField is used in a FormLayout iterate all data-fields of the Project and query the usage:

  // Enumerate all DataFields in the Project
  HPROJECTVAR_ITERATOR  it                = TFormer_GetFirstProjectVarIt (hTForm, pszProjectName, &eCode);
  BOOL                  bProjectVarValid  = (it != NULL);
  LPCSTR                pszDataFieldName  = NULL;

  // TYPE_E_ELEMENTNOTFOUND should not be treated as error
  if (eCode == TYPE_E_ELEMENTNOTFOUND)
    eCode = ErrOk;

  // iterate all DataFields
  while (bProjectVarValid && (eCode == ErrOk))
  {
    // Query the DataField usage in the given FormLayout
    EVarUsage eVarUsage = TFormer_ProjectVarItGetUsage (hTForm, it, &eCode);
    if ((eVarUsage == eVarUsage_Normal) && (eCode == ErrOk))
    {
      pszDataFieldName = TFormer_ProjectVarItGetName (it, &eCode);
      if (pszDataFieldName != NULL && eCode == ErrOk)
        printf ("  %s\n", pszDataFieldName);
    }

    // get next DataField
    bProjectVarValid = (TFormer_GetNextProjectVarIt (it) == ErrOk);
  }
  // release iterator
  TFormer_FreeProjectVarIt (it);


NameInitializerDescription
eVarType_Text= 0

A text (string or character).

This is the recommended DataFieldType.

eVarType_Long= 1

An integer number.

When reading a DataField of this type from a JobData it is converted automatically to an integer. In case of conversion errors the result is 0 (no error or exception will be raised).

eVarType_Float= 2

A floating point number.

When reading a DataField of this type from a JobData it is converted automatically to a floating point number. In case of conversion errors the result is 0 (no error or exception will be raised).

eVarType_Invalid

Invalid, internal use only.

EPrinterType

enum EPrinterType

This enumeration specifies the type of output generated by TFORMer SDK.

Choose between direct printing (Win32, Repository, Cups, PostscriptPrinter, TextPrinter, ZPLPrinter) and other supported output formats (PostscriptFile, HtmlFile, PdfFile, TextFile, ZPL-file or the various image formats).

NameInitializerDescription
ePrinterType_Default= 0

The default output device type.

The output device which will be used depends on the type of the FormLayout to be printed.

  • Repository based FormLayout
    A printer of type Repository will be used. Without the specification of a PrinterName the default printer within this Repository (named _Default_) is used.

  • Stand-alone FormLayout
    A printer of type Win32 will be used on Microsoft Windows. For Linux and UNIX a printer of type Cups will be used.

ePrinterType_Win32

Direct printing to a Windows printer via GDI-calls (Microsoft Windows only).

ePrinterType_Repository

The printer as defined in the Repository or stand-alone FormLayout.

In the later case only the printer _Default_ is used (which maps to the default printer of the current user). To use other printers set the PrinterType to Win32.

ePrinterType_Cups

A CUPS printer (Linux and UNIX only).

ePrinterType_PSFile

This printer type generates PostScript output as file.

The PostScript header and footer used for each page may be customized. See Footer.ps and Header.ps in the TFORMer installation directory for details.

ePrinterType_HTML

This printer type generates HTML output as file.

Some aspects of the index page and the footer appended to each generated HTML page may be customized. See Footer.html and Template.html in the TFORMer installation directory for details.

ePrinterType_PDFFile

This printer type generates PDF output as file.

ePrinterType_PSPrinter

This printer type sends PostScript output directly to the specific printer.

The PostScript header and footer used for each generated page may be customized. See Footer.ps and Header.ps in the TFORMer installation directory for details.

ePrinterType_TxtPrinter

This printer type sends ASCII output directly to the specific printer.

ePrinterType_TxtFile

This printer type generates ASCII output as file.

ePrinterType_ImageBmp

This printer type generates BMP image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImageGif

This printer type generates GIF image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImageJpg

This printer type generates JPG image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImagePcx

This printer type generates PCX image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImagePng

This printer type generates PNG image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImageTga

This printer type generates TGA image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImageTifSingle

This printer type generates TIFF image files (one image file per page).

The specified filename may contain #-characters as placeholders for the page-number.

ePrinterType_ImageTifMultiPage

This printer type generates multi-page TIFF image files (one image contains all output pages).

ePrinterType_ZPLPrinter

This printer type sends ZPL-II (ZEBRA Printer Language) output directly to the specific printer (Microsoft Windows only).

ePrinterType_ZPLFile

This printer type generates ZPL-II (ZEBRA Printer Language) output as file.

ePrinterType_PDFA

This printer type generates PDF/A output as file.

ePrinterType_ZUGFeRD

This printer type generates ZUGFeRD PDF/A-3 output as file and attaches the given ZUGFeRD-invoice.xml to it (see http://www.zugferd.de).

ePrinterType_SVG

This printer type generates SVG (Scalable Vector Graphics) output as file.

ePrinterType_SVGZ

This printer type generates SVGZ (Compressed Scalable Vector Graphics) output as file.

ePrinterType_Invalid

Invalid or unspecified printer type.

Do not use this value (internal use only).

EVarUsage

enum EVarUsage

Describes the usage of a DataField within a FormLayout.

NameInitializerDescription
eVarUsage_NotUsed= 0

The DataField is defined within the Project but is not used in the FormLayout.

eVarUsage_Normal

A normal DataField.

The DataField is in use by the FormLayout, its value is not modified. The DataField is just used as part of expressions or directly in text-, bar-code or picture elements. Therefore the value for this DataField may be provided by an external application or by the user.

eVarUsage_Calculated

The DataField is computed automatically.

The DataField is in use by the FormLayout and its value is modified. Usually this is done via pre- or post-expressions. Therefore the value for this DataField may not be provided by an external application or by the user.

eVarUsage_Parameter

This is a writable system-DataField used by the FormLayout.

The value of this system-DataField may be provided by an external application or by the user (e.g. tfDocumentName).

eVarUsage_Invalid

Invalid.

ETFDataFormat

enum ETFDataFormat

Describes the desired format for requested data (e.g.

NameInitializerDescription
eTFDataFormat_XML
eTFDataFormat_Invalid

ERRCODE

#define ERRCODE LONG

Define the type for the error codes.

ErrOk

#define ErrOk S_OK

Define error code for "no error" (ErrOk, 0).

ERR_TF_LICENSE_EXPIRED

#define ERR_TF_LICENSE_EXPIRED 27019

Error code for "TFORMer license is expired".

Search documentation

Search in
More scopes
Additional scopes

All contents