# ServerTextControl

> Build, merge, convert or print documents in a Windows Forms app without a form: create ServerTextControl in a using block, call Create, pass byte arrays.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for Windows Forms > Overview > Components > ServerTextControl
- **1269 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/servertextcontrol/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/servertextcontrol/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/servertextcontrol/llms-full.txt

---

Not every document your application handles has to be shown on screen. `ServerTextControl` creates, converts and merges documents in code, with the same programming interface as `TextControl` but without a window, and hands the result to the editor when the user should see it. What follows introduces when a desktop application uses it, the pattern every use follows and its key members.

### What ServerTextControl Is

[ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/llms-full.txt) is a component that provides the word processing features of TX Text Control without a user interface. The class is `TXTextControl.ServerTextControl`, derived from `System.ComponentModel.Component` rather than from `Control`, so it needs no form and is never visible.

Its programming interface is that of [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/textcontrol/llms-full.txt): the same `Load` and `Save` methods, the same `Selection`, and the same collections of tables, images, fields and other elements. Code that builds or changes a document works with either class.

### When a Desktop Application Uses It

A desktop application uses `ServerTextControl` for documents the user doesn't watch being made: it builds or merges a document before the editor shows it, converts or prints files in the background, or runs a [MailMerge](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/mailmerge/llms-full.txt) while the editor shows something else. Without a user interface, it keeps no undo history and renders nothing for the screen, so it needs less time and memory than a `TextControl` for the same work.

### How You Work With It

Every use follows the same pattern: create an instance in a `using` statement, call [Create](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/create-method/llms-full.txt) before any other member, load or build the document, and save it. A document moves to the editor as a byte array, because `TextControl` has the same byte array overloads of `Load` and `Save`.

[Using ServerTextControl in Desktop Applications](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-processing/servertextcontrol/llms-full.txt) shows this pattern in code, passes documents between the two classes, runs long work on a background thread and merges templates without the editor. [Create a Document Programmatically](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-processing/create/llms-full.txt) in Getting Started builds a first document.

The format is given as a [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) for a file or a stream, a [BinaryStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/binarystreamtype/enumeration/llms-full.txt) for a byte array and a [StringStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) for a string. [Supported File Formats](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/file-formats/llms-full.txt) lists the values.

### Key Members

| Member | Purpose |
|---|---|
| [Create](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/create-method/llms-full.txt) | Initializes a new instance. It must be called before the object is used. |
| [Load](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/load-method/llms-full.txt) | Loads a document and replaces the complete contents. |
| [Append](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/append-method/llms-full.txt) | Adds a document to the end of the existing one. |
| [Save](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/save-method/llms-full.txt) | Saves the complete document in the specified format. |
| [Text](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/text-property/llms-full.txt) | Gets or sets the text of the document. |
| [Selection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/selection-property/llms-full.txt) | The current selection, used to insert text and to apply formatting. |
| [Tables](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/tables-property/llms-full.txt), [Images](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/images-property/llms-full.txt), [HeadersAndFooters](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/headersandfooters-property/llms-full.txt) | The tables, images, headers and footers of the document. |
| [ApplicationFields](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/applicationfields-property/llms-full.txt) | Fields such as MS Word merge fields. `LoadSettings.ApplicationFieldFormat` must be set before loading, otherwise the collection is empty. |
| [FormFields](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/formfields-property/llms-full.txt), [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/comments-property/llms-full.txt), [TrackedChanges](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/trackedchanges-property/llms-full.txt) | The form fields, comments and tracked changes. |
| [Print](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/print-method/llms-full.txt) | Prints the document with a `PrintDocument`, without showing it. |
| [EntryAssembly](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/entryassembly-property/llms-full.txt) | A static property that sets the assembly which licenses `ServerTextControl`, for example when it is used in a class library. |

The [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/servertextcontrol/llms-full.txt) reference lists all members.

### Next Steps

- [Create a Document Programmatically](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/getting-started/document-processing/create/llms-full.txt): a first document built in code.
- [Using ServerTextControl in Desktop Applications](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-processing/servertextcontrol/llms-full.txt): background work, threads and the editor in detail.
- [Document Processing](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/document-processing/llms-full.txt): creating, loading, saving and changing documents in code.
- [MailMerge](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/mailmerge/llms-full.txt): merge templates with data in a `ServerTextControl`.

---

## Nearby

- **Previous:** [MailMerge](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/components/mailmerge/llms-full.txt)
- **Next:** [Supported Platforms](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/overview/platforms/llms-full.txt)
