Silent Setup TFORMer

Silent Setup of TFORMer 4.5

First, generate a response file:

TFORMer_Setup_4_5.exe /r /f1"C:\temp\setup.iss"

then execute it with silent:

TFORMer_Setup_4_5.exe /s /f1"C:\temp\setup.iss"

Silent Setup of TFORMer Runtime V5, TFORMer SDK V6+

You can install the TFORMer COM component as follows:

msiexec /i TFORMer_6_0_0.msi INSTALLDIR=C:\TFORMer ADDLOCAL=FeatRuntime,FeatCOM /qn

If you left out INSTALLDIR, the default directory is used for installation (C:\Program Files...)

The ADDLOCAL parameter specifies the features to be installed (multiple Features allowed, separate them with a colon). Here are some examples:


TFORMer V7.5.20+

Use the standard EXE setup program, which is available for public download. You can select the feature you want to install with specific feature options - e.g. if you want to install only the .NET component and tfprint in quiet mode run the setup this way:

TFORMer_SDK.exe /quiet FeatTemplates=0 FeatCmdLine=1 FeatDLL=0 FeatCOM=0 FeatNET=1 FeatJava=0 FeatQuickPrint=0 FeatDocu=0

Optional: add parameter InstallFolder=C:\MyInstallDir to install into a specific directory. You can also suppress installation of the VC++ Runtime with InstallVCRuntime=0

Please run the EXE with option -? to see all available command line options.

TFORMer_SDK.exe -?
The setup program contains both the 32 and 64 Bit components, which are selected automatically depending on the target Windows version. By default the setup downloads the Visual C++ Redistributable from Microsoft and installs it if not present on the target system. Alternatively you can copy the vc_redist.x86.exe and vc_redist.x64.exe (must be V14.0.24215!) into the setup path if there is no download connection.

Missing Visual Studio (C/C++) Runtime Libraries

TFORMer SDK requires the Common Runtime Libraries from Visual Studio 2010 or later (exact version see below). These runtime files are installed by the TFORMer SDK setup automatically.

These libraries are not part of a Windows standard installation. But it is possible to install these libraries from an extra package available from Microsoft:

For more information regarding redistributing TFORMer, see section Distribution and Deployment in the Developer Manual.

Retrieving Data Fields Used in a Layout (TFORMer. NET API)

Data fields in a repository

Repository repository = new Repository ("C:\\Path\\Labels.tfr", false, false);
Project project = repository.GetProject("BarcodeLabels");
FormLayout formlayout = project.GetFormLayout("Label1");
// iterate through all DataFields in the project
for (DataField field = project.FirstDataField; field != null; field = field.Next)
// check if the DataField is used in the FormLayout
DataFieldUsage usage = formlayout.GetDataFieldUsage(field.Name);

  if (usage == DataFieldUsage.Normal)
    // DataField used in the FormLayout

Data fields in a TFF

// create a Repository-instance using a stand-alone FormLayout
Repository repo = new Repository("C:\\Path\\Label.tff", false, false);

// retrieves the global project
Project project = repo.GlobalProject;

// retrieves the one and only FormLayout (stand-alone form)
FormLayout formlayout = project.FirstFormLayout;

// retrieving the data fields:
// use the same code as with the repository (see above)

How Can I Adjust the Number of Copies for a Record Set?


// record set data source 
DataSourceRecordSet recordSet = new DataSourceRecordSet(); 
Record record = new Record(); 
record.NumberOfCopies = 10; 

// CSV, ODBC and other data sources
DataSourceCsv dsCsv = new DataSourceCsv(csvFile, ',', '"'); 
Job printJob = new TECIT.TFORMer.Job(); 
printJob.DataSource = dsCsv; 
printJob.RecordCopyDataField = "Copies"; 

How Can I Import a CSV File via Program Code?

The following sample code shows how to use CSV import with a CSV data source defined in the TFF layout file (using TFORMer Designer). For more flexibility it has been configured with a parameter, which specifies the file path: parFilePath


// create new job
job = new Job();

File file = new File ("c:\\Temp\\MyTemplate.tff");

// Select the Data Source named 'ImportFromCSV' (defined in the Form Layout)
JobDataDataSource jobData = new JobDataDataSource ("ImportFromCSV");

// Set the Data Source Parameter named 'parFilePath'
jobData.setParameterValues ("parFilePath", "C:\\Temp\\myImportFile.csv");   

// Set the output format:
// e.g. EPrinterType.PDFFile, EPrinterType.ZPLFile, EPrinterType.ImagePng

// Output file name
job.setOutputName(System.getProperty("user.dir") + File.separator + "MyLabel.PDF");
System.out.println("Printing to " + job.getOutputName());

// Generate Output
The advantage with using a data source defined in the layout: The data source definition may contain the mapping between import fields and layout fields, in addition you can add calculated fields (on demand). Optional data source parameters give you the flexibility for programming or command line interaction.

How Can I Set the Resolution for a Zebra Printer?

Beside changing the resolution for Zebra (ZPL II) printers directly in the Designer print dialog, you can adjust it also for the SDK or Quickprint as shown below.
The DPI can be permanently set / changed in the TFORMer.xml configuration file (per user and per system).

Location of TFORMer.xml on Microsoft Windows

  • The default (system-wide) TFORMer.xml resides in the directory
  • In addition, TFORMer supports user specific files which override the default. TFORMer Designer creates this file automatically in a user specific folder:

Setting the Resolution / DPI for Zebra

  • Locate the <ZEBRA> node and edit the resolution attribute, which specifies the DPI of the Zebra printer.
  • After saving the file, restart your SDK application (e.g. Quickprint) to read in the new settings.

For further information, see Appendix C: Configuration File TFORMer.xml in the TFORMer Developer Manual.

How Can I Change the Barcode Draw Mode to Quality?

In some cases you want to change the bar code draw mode for trouble shooting enlarged bars on thermal transfer printers like Printronix T4M or Zebra.

Beside changing the draw mode in the Designer print dialog (Options button), you can adjust it also for the SDK or Quickprint in the TFORMer.xml configuration file on a per user or system basis.

Location of TFORMer.xml on Microsoft Windows

  • The default (system-wide) TFORMer.xml resides in the directory
  • In addition, TFORMer Designer maintains a user specific file which overrides the default file. This file is created in the user specific folder:
  • If you deliver a local configuration file along with your application (EXE), it takes precedence over the standard files in the user or program data directories.

Changing the GDI Draw Mode to 'Quality'

  • Open the TFORMer.xml configuration file(s) as indicated above.
  • Locate the <WINGDI><TBARCODE> node.
  • Change the drawing-mode attribute to “2” <TBARCODE drawing-mode="2" />
  • After saving the file, restart your SDK application (e.g. Quickprint) to read in the new settings.

SDK Option

  • In case you don't want to change the drawing mode permanently, you can change it also dynamically by program code (or command line) with the following SDK option: tbarcode-drawing-mode=quality

How Can I Change the Orientation for ZPL Printers?

The orientation is defined in the page settings in the layout. If your printer does not support the original media settings from the layout, you can override them with SDK options. SDK options can be specified for each job either programmatically or via command line.

Below we discuss the required SDK options for two cases:

Case A

TFORMer Page Settings

  • Media=A6
  • Orientation=Landscape

Applying Page Settings to Media in the Printer

  • Media (Printer) = A6 Portrait
    - Print with Media=A6 Orientation=Landscape ⇒ output will be rotated to fit
    - Page settings can be applied without modification.
  • Media (Printer) = A6 Landscape
    - Set media size to A6 Landscape ⇒ Custom.148mmx105mm
    - Set orientation to Portrait ⇒ no rotation
    media=Custom.148mmx105mm orientation=portrait

Case B

TFORMer Page Settings

  • Media=A6
  • Orientation=Portrait

Applying Page Settings to Media in the Printer

  • Media (Printer) = A6 Portrait
    - Print with Media=A6 Orientation=Portrait ⇒ no rotation
    - Page settings can be applied without modification.
  • Media (Printer) = A6 Landscape
    - Set media size to A6 Landscape ⇒ Custom.148mmx105mm
    - Set orientation to landscape ⇒ output will be rotated to fit
    media=Custom.148mmx105mm orientation=landscape
Instead of specifying a custom media size for A6 Landscape, you can also add A6LS with the size of A6 Landscape to TFORMer.xml and reference A6LS in the media parameter.

TFORMer SDK Has a Different Label Size than the Designer

That's because the DLL reads the Default Settings found in the Advanced tab, the Designer reads the Printing Preferences found in the General tab of the printer properties (driver settings).

Solution: Adjust the General Settings of the printer driver in a way that it has the same values as the Default Settings of TFORMer SDK or vice versa.

Licensing TFORMER SDK in MS-IE Through LPK File

LPK licensing is not supported in TFORMer V4.5, V5.0, V6.0. If required, please contact us!

Display and Print a PDF in the Browser (MSIE) Without User Interaction

This can be achieved with the Acrobat PDF Control (AcroPDF.PDF), which is installed with Acrobat Reader. Insert the following code into your HTML page and view it with MSIE.

<OBJECT id="AcroPDF1"  style="width: 750px; height: 550px" 

// load from URL
// or load from file
// AcroPDF1.LoadFile("c:\\temp\\dok2.pdf");

// print all
// AcroPDF1.printAll();
// or print pages from to
AcroPDF1.printPages (1, 2);

Generate a Repository and Open TFORMer Designer via .NET API

Below we show you how to generate a repository programmatically and open TFORMer Designer through TFORMer API.

Note: The XMD file (repository based designer file) is not generated automatically. You have to generate an empty XMD file with designer (store this file somewhere in your .NET project) and then copy it into the right location (Forms/[ProjectName] subdirectory) during form creation.

using TECIT.TFORMer; 
using System.IO;  // FileInfo class

String repositoryPath = @"C:\temp\test\myRep.tfr"; 
String projectName = "myProject"; 
String formName = "myForm"; 

FileInfo repositoryFile = new FileInfo(repositoryPath); 

if (!repositoryFile.Exists) 
  // create new repository (read-only flag = false) 
  Repository newRepository = new Repository(repositoryPath, true, false); 
  // add project 
  Project newProject = newRepository.AddProject(projectName); 
  // add form 
  FormLayout newFormLayout = newProject.Add FormLayout(formName); 
  // set file name 
  newFormLayout.Filename = newFormLayout.Name + ".xmd"; 
  // close and save changes !!! 
  // TO DO: 
  // add "Forms" sub directory if not exist 
  // add "Forms\myProject" sub directory if not exist 
  // copy empty xmd file to Forms\myProject\ (file name must be like set above) 
// if repository exists (with project and form !): 
// open for editing 
Repository repository = new Repository(repositoryPath, false, false); 

// get project 
Project project = repository.GetProject(projectName); 

// get form 
FormLayout formlayout = project.GetFormLayout(formName); 

// open TFORMer Designer
formlayout.Design(@"C:\Program Files\TEC-IT\TFORMer6\Bin\TFORMer.exe",
   true, true, false, null); 
//formlayout.Design(null, true, true, false, null);

Printing to UNC Path is Slow

If you see a delay when you print to a printer located on a remote print server (via UNC path, printer is NOT installed locally) the reason can be printer driver caching issues. Also status polling, network speed, etc plays a role here.

To resolve the issues, you should install the printer locally. It may also help to just connect to the printer in question - this also triggers driver download and may improve the responsitivity.

How can I Generate a PDF with Special Characters?

When using TFORMer SDK to create a PDF you may encounter the following exception:

The text contains Unicode characters which cannot be printed with the current settings or font. Information: Error Code: 0x0000697c

In order to add the missing Unicode character(s) to the embedded font(s), go to TFORMer Designer menu Tools > Options > PDF: Embed Font with „True Type-Subgroups“.

Selection of TrueType-Subgroups in Fonts category

If your TFORMer SDK project uses a specific TFORMer.xml configuration file, set the option: <PDF ... embed-subset-fonts="1"

How Can I Print a TFORMer Report with Python?

For printing a TFORMer report with Python you can use the following script as example:

 from ctypes import *

 FormFile     = "c:/pathto/formfile.tff"
 DataFile     = "c:/pathto/importdata.csv"

 TF_dll = oledll.LoadLibrary("TFormer60.dll")

 TF_dll.TFormer_LicenseMe("Your Licensee Name ", 4, 1,"Your Key" )
 htform =  TF_dll.TFormer_Init(0)
 rm = TF_dll.TFormer_SetRepositoryName(htform, FormFile)
 rm = TF_dll.TFormer_ResetData(htform)
 rm = TF_dll.TFormer_SetTxtDataFile(htform, DataFile, c_char(","), c_char(" "))
 rm = TF_dll.TFormer_SetCopies(htform,1)
 rm = TF_dll.TFormer_SetStartPosition(htform, 1, 0)
 rm = TF_dll.TFormer_SetPrinter(htform, "", 0)
 rm = TF_dll.TFormer_PrintForm(htform)

print 'finished'

DllNotFoundException (0x800703E6), Could Not Load DLL "TFormer75x64.dll"

Problem (.NET API): One of the required dependencies is missing or could not be found.

Search Order for Dependencies:

  • Local path of assembly
  • Path of executable
  • Path contained in PATH environment variable

Make sure that the TFORMer DLLs (see section deployment and distribution in the developer manual) are in one of these locations.

Using TFORMer .NET in a Web Application (IIS)

There are two possibilities:

  • Install as local assembly (no GAC): Copy all TFORMer files into the bin sub folder of your web application - you need the TFORMer Assembly + dependency DLLs + TFORMer.xml. Make sure that there is no TFORMer Assembly installed in the GAC: Uninstall TFORMer SDK setup if already installed. Restart IIS application pool(s) to reload the assemblies. Afterwards all DLLs should be found.
  • Install as global assembly (GAC): Use our TFORMer SDK setup, which installs TFORMer .NET in the GAC and extends the PATH environment variable so that all dependencies are found. Note that updating the PATH environment variable may require an IIS restart (iisreset on admin console) or a system reboot, otherwise the DLLs are still not found.
If you don't use our setup make sure that the Visual Studio Runtime Libraries are installed (the required Runtime Version depends on the TFORMer Release - see developer manual).

Exception: Required Permissions Cannot Be Acquired

If you run your application from a network location (UNC path) you may get the above exception when your application tries to load the native compiled TFORMer DLLs.

This is an issue with the .NET Framework's trust level settings on your local machine. The default trust level for the local machine is "Full Trust", whereas for the network share it is not.

Either install the TFORMer SDK on the local workstation(s) and avoid loading them from a network path - or lower the security settings on your machine(s). You can give a specific network path full trust with the Caspol command (for details see the Caspol documentation from Microsoft). The following command would give the local intranet zone full trust (not recommended):

Caspol –m –cg LocalIntranet_Zone FullTrust

Install AutoDoc As Service

If the setup fails to install TFORMer AutoDoc 7.5 as system service, you can use the following command line to install it through PowerShell.

  • Install TFORMer SDK 7.5 and .NET 3.5 as prerequisite.
  • Run the AutoDoc installer: If the service cannot be installed, click Ignore and continue with the setup.
  • Run Windows PowerShell as Administrator (type powershell on the Windows start menu)
  • Copy and paste the following command into the shell command line (replace the -Credential with an account, which has sufficient permissions)
    new-service -Name TECIT.TFORMer.AutoDoc -DisplayName "TFORMer AutoDoc 7.5" -Description "Automatic document generation service utilizing TFORMer SDK 7.5" -BinaryPathName '"C:\Program Files (x86)\TEC-IT\AutoDoc 7.5\AutoDoc.exe" "C:\Program Files (x86)\TEC-IT\AutoDoc 7.5\config.xml"' -StartupType Manual -Credential "domain\user"
  • Configure the service (startup type, account...) under Windows Services.

Programming TFORMer5 COM (Visual C/C++, ODBC)

TFORMer5 COM with Visual C/C++ 6 MFC

ITFORMer* tf = new ITFORMer ();

IJob job = tf->CreateJob (); 

job.SetRepositoryName ("C:/../Repository/Demos.tfr");

IDataSourceRecordSet records = job.NewDataSourceRecordSet();
records.SetDataField("ArticleName", "Mac Adapter");
records.SetDataField("ArticleNo", "12001234");
records.SetDataField("ArticlePrice", "39,00");




Dim tf As TFORMer5Lib.TFormer
Dim printjob As TFORMer5Lib.IJob
Dim datasource As TFORMer5Lib.IDataSourceOdbc

Dim dsn
Dim uid
Dim password
Dim sql

dsn = "DSN=TFORMer_Sample"
uid = ""
password = ""
sql = "SELECT * FROM tbl_Example;"

Set tf = CreateObject("TFORMer5Lib.TFormer")
Set printjob = tf.CreateJob

printjob.RepositoryName = "R:\ODBCTest\TFORMer1.tff"
Set datasource = 
printjob.NewDataSourceOdbc(dsn, uid, password, sql)

printjob.PrinterName = "PDF:R:\ODBCTest\out.pdf"

TFORMer5 Can't Use JPEG Images via HTTP-Link

When TFORMer Layouts use images which are loaded from an external http-source the user must take care that the link is using a correct file extension.

For example:

Wrong URL: BaseUrl + Thumbnail?file=label-me
Correct URL: BaseUrl + Thumbnail?file=label-me.jpg