Printing and Output
Select output settings and generate output from a stand-alone or Repository based FormLayout.
Overview
The native C API uses an instance handle returned by TFormer_Init. Use this handle to select a stand-alone or Repository based FormLayout, provide data and generate output. No separate Job or JobData objects are required.
You can select the output type and destination (Printing and Export), set output options (Print Options), and select a configuration file (TFORMer.XML Configuration File).
Workflow
The basic steps to generate output are as follows:
Initialize an instance with TFormer_Init and check the returned handle.
Select the layout with TFormer_SetRepositoryName. For a repository, also select the project and form with TFormer_SetProjectName and TFormer_SetFormName.
Select the output type and destination; see Printing and Export. Set any options needed for data handling before supplying data.
Provide records and field values, import data, or use a data source defined in the layout; see JobData.
Generate output with TFormer_Print, or use TFormer_PrintToStream for an application-provided output callback.
Release the instance with TFormer_Exit, including after an error.
Check the return code of each operation before continuing; see Error-Handling. Native setters take effect when called. Select the layout before supplying data. If you use a layout-defined data source, select it before setting its parameters. Changing the selection can discard cached records. For the interaction of output type, printer name and output name, see Combining Output Settings.
More Information
JobData
Providing data to the native instance
| Name | Kind | Purpose |
|---|---|---|
| EWriteCallBack | enum | Enumerations used in the TFN_StreamWriteCallback function. |
| ETFPrintResultType | enum | Describes the data that should be stored while generating the output. |
| TFN_StreamWriteCallback | typedef | Callback function for streamed output. |
| TFormer_SetRepositoryName | function | Sets the filename of the Repository or the filename of the stand-alone FormLayout for this Job. |
| TFormer_SetPrinterType | function | Sets the type of the generated output. |
| TFormer_SetPrinterName | function | Sets the name of the output device (file or printer). |
| TFormer_SetJobTrayControlName | function | Sets the name of the JobTrayControl to be used for this Job. |
| TFormer_SetProjectName | function | Specifies the Project-name for printing a Repository-based FormLayout. |
| TFormer_SetFormName | function | Specifies the name of the Repository-based FormLayout. |
| TFormer_SetNumberOfCopies | function | Sets the number of document copies to be printed. |
| TFormer_SetStartRowColumn | function | Selects the starting cell of the first label to be printed. |
| TFormer_SetOutputName | function | Sets the name of the output file or the name of the spool-job (on Microsoft Windows printers). |
| TFormer_SetPageFromTo | function | Sets the range of page-numbers to be the printed. |
| TFormer_SetPrintOptions | function | Sets additional options for printing and output generation. |
| TFormer_SetConfigFile | function | Sets the configuration file for TFORMer SDK. |
| TFormer_Print | function | Prints the current FormLayout using the adjusted DataSource. |
| TFormer_PrintToStream | function | Generates output through a callback using the current FormLayout with the adjusted DataSource. |
| TFormer_SetPrintResultType | function | Set the type of data that should be gathered, while printing. |
| TFormer_GetPrintResult | function | Gets the data of the last print operation in specified format. |
EWriteCallBack
enum EWriteCallBack
Enumerations used in the TFN_StreamWriteCallback function.
The TFN_StreamWriteCallback is required only when generating output as in-memory stream(s).
See also
| Name | Initializer | Description |
|---|---|---|
eWriteCallBack_Open | = 1 | Event for opening a stream. pData points to the name of the stream which is an UTF-8 encoded string |
eWriteCallBack_Data | = 2 | Event for new stream-data. pData points to the available data. |
eWriteCallBack_Close | = 3 | Event for closing a stream. pData is |
ETFPrintResultType
enum ETFPrintResultType
Describes the data that should be stored while generating the output.
After the output has been generated the data can be retrieved by a call to TFormer_GetPrintResult.
| Name | Initializer | Description |
|---|---|---|
eTFPrintResultType_None | = 0 | No data should be generated. |
eTFPrintResultType_Basic | | Only basic information should be generated. |
eTFPrintResultType_Medium | | Additional data will be stored. |
eTFPrintResultType_Full | | All information possible will be stored and is available after output generation. |
TFN_StreamWriteCallback
typedef ERRCODE(* TFN_StreamWriteCallback) (BYTE *pData, INT nSizeData, DWORD eWriteCallback, LPARAM lParam);
Callback function for streamed output.
If output is generated to an in-memory stream this function is required. It is called multiple times during the lifetime of a stream.
Returns
ErrOk (0) in case of success, non-zero if an error occurred
Parameters
| Parameter / type | Description |
|---|---|
pData |
|
nSizeData |
|
eWriteCallback |
The type of the callback event (open, data, close) - see EWriteCallBack |
lParam |
|