# Server Visualization

> Render documents, rulers, status bars and dialog boxes as images on the server with TextViewGenerator, View, UserInput and the other ServerVisualization types.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Document Processing > Server Visualization
- **7442 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/server-visualization/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/server-visualization/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/server-visualization/llms-full.txt

---

`ServerTextControl` has no user interface, but the classes of the `TXTextControl.ServerVisualization` namespace give it one in the form of images. A `TextViewGenerator` renders any part of a document as an image, takes keyboard and mouse input for it and tells you which part of the image changed; further generators render ruler bars, a status bar and the built-in dialog boxes. With them, an application can show and edit a document in a user interface of its own.

To render complete pages, for example as thumbnails or for a comparison, you don't need these classes: `Page.GetImage` does it, as [Pages](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/pages/#render-pages-as-svg-images) shows. The namespace was introduced with version 21.0.

### What the Namespace Contains

Every generator manages two objects: a [View](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/llms-full.txt), which defines the part that is rendered and returns its image, and a [UserInput](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/llms-full.txt), which passes keyboard and mouse input to the generator. When the input changes the image, the view raises its `Changed` event.

| Class | Renders | Created |
|---|---|---|
| [TextViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/llms-full.txt) | The text of the document. It is derived from `ServerTextControl`, so it loads, changes and saves documents like one | With `new` and `Create` |
| [RulerBarViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/llms-full.txt) | A horizontal or vertical ruler bar that shows the formatting at the input position of a connected `TextViewGenerator` | With `new` and [Create](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/create-method/llms-full.txt) |
| [StatusBarViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator/llms-full.txt) | A status bar with the page, line, column, section and zoom factor of a connected `TextViewGenerator` | With `new` and [Create](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator/create-method/llms-full.txt) |
| [DialogViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/llms-full.txt) | One of the built-in dialog boxes | By [TextViewGenerator.GetDialogBox](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/getdialogbox-method/llms-full.txt) |

`TextViewGenerator` also has settings that `ServerTextControl` doesn't have. One of them records tracked changes, as [Record Changes on the Server](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/track-changes/#record-changes-on-the-server) describes.

### Render a Part of a Document

The view's [Location](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/location-property/llms-full.txt) and [Size](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/size-property/llms-full.txt), both in twips (1/1440 inch), define the part of the document that is rendered, and its [ZoomFactor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/zoomfactor-property/llms-full.txt) the zoom factor in percent, from 10 up. The following program saves the top of a document as a PNG file:

```csharp
using System.Drawing;
using TXTextControl;
using TXTextControl.ServerVisualization;

using (TextViewGenerator tx = new TextViewGenerator())
{
    tx.Create();
    tx.Load("Documents/sample.docx", StreamType.WordprocessingML);

    // The part of the document to render, in twips: 8.5 x 5 inches
    tx.View.Location = new Point(0, 0);
    tx.View.Size = new Size(12240, 7200);
    tx.View.ZoomFactor = 100;

    if (tx.View.GetImage(out byte[] png))
    {
        File.WriteAllBytes("view.png", png);
        Console.WriteLine($"view.png: {png.Length} bytes");
    }
}
```

The code works as follows:

- `TextViewGenerator` is created and loaded like a `ServerTextControl`: `Create` comes first.
- [TextViewGenerator.View](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/view-property/llms-full.txt) returns the view of the generator.
- [View.GetImage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getimage-method/llms-full.txt) with an `out byte[]` parameter returns the image in PNG format and `true` if it succeeded.

`GetImage` has these overloads:

| Overload | Returns |
|---|---|
| `GetImage()`, `GetImage(Rectangle clipRectangle)` | The image or a clipping of it as a `System.Drawing.Imaging.Bitmap` |
| `GetImage(out byte[] arImage)`, `GetImage(out byte[] arImage, Rectangle clipRectangle)` | The image or a clipping of it as a byte array in PNG format |
| `GetImage(Rectangle clipRectangle, int iFirstInvalidLine, int iLastInvalidLine, int iMaxImageResolution)` | A clipping as a string in SVG format, with the characters as outlines. The clipping is a range of one-based line numbers, or the rectangle when both line numbers are 0. Images are embedded as PNG with at most the given resolution |

A clipping rectangle is in pixels, relative to the top-left corner of the view's image. The `Bitmap` overloads need `System.Drawing.Common`, which the Classic package `TXTextControl.TextControl.ASP.SDK` depends on and the Core package doesn't. The resolution of the images, in dots per inch, is set with [TextViewGenerator.Resolution](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/resolution-property/llms-full.txt); 0 uses the resolution of the system. [TextViewGenerator.Zoom](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/zoom-method/llms-full.txt) zooms with a factor or a [ZoomOption](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/zoomoption/enumeration/llms-full.txt) value.

### Pass User Input and Update the Image

The methods of `UserInput` pass keyboard and mouse events to a generator, which reacts as an editor would: a click moves the input position, a key press inserts a character. Each method returns `true` if the generator handled the event. When the image of the view changes, [View.Changed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/changed-event/llms-full.txt) reports the part that has to be drawn again:

```csharp
using System.Drawing;
using TXTextControl;
using TXTextControl.ServerVisualization;

using (TextViewGenerator tx = new TextViewGenerator())
{
    tx.Create();
    tx.Load("Documents/sample.docx", StreamType.WordprocessingML);

    tx.View.Location = new Point(0, 0);
    tx.View.Size = new Size(12240, 7200);

    // Report each part of the image that changes
    tx.View.Changed += (sender, e) =>
        Console.WriteLine($"Changed: {e.ClipRectangle}, scrolled: {e.ScrollOrientation}");

    // A click at 100, 100 pixels in the view, then two typed characters
    Point click = new Point(100, 100);
    tx.UserInput.SendMouseDown(click, UserInput.MouseButtons.Left, UserInput.ModifierKeys.None);
    tx.UserInput.SendMouseUp(click, UserInput.MouseButtons.Left, UserInput.ModifierKeys.None);
    tx.UserInput.SendKeyPress('O', UserInput.ModifierKeys.Shift);
    tx.UserInput.SendKeyPress('k', UserInput.ModifierKeys.None);

    // Only the changed part is rendered again
    Rectangle update = tx.View.GetUpdateRectangle(true);

    if (!update.IsEmpty && tx.View.GetImage(out byte[] png, update))
    {
        File.WriteAllBytes("update.png", png);
    }
}
```

The code works as follows:

- [TextViewGenerator.UserInput](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/userinput-property/llms-full.txt) returns the `UserInput` object of the generator.
- [SendMouseDown](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/sendmousedown-method/llms-full.txt) and [SendMouseUp](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/sendmouseup-method/llms-full.txt) take a location in pixels, relative to the top-left corner of the view, a [MouseButtons](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/mousebuttons-enumeration/llms-full.txt) value and a combination of [ModifierKeys](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/modifierkeys-enumeration/llms-full.txt) values. `SendMouseMove`, `SendMouseDoubleClick` and `SendMouseWheel` work the same way; the wheel's distance is a multiple of 120.
- [SendKeyPress](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/sendkeypress-method/llms-full.txt) takes the translated character code, and [SendKeyDown](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/sendkeydown-method/llms-full.txt) and [SendKeyUp](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/userinput/sendkeyup-method/llms-full.txt) the virtual key code, for keys such as the arrow keys.
- The `Changed` event passes a [ViewChangedEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/viewchangedeventargs/llms-full.txt) object. [ClipRectangle](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/viewchangedeventargs/cliprectangle-property/llms-full.txt) is the changed area in pixels. [ScrollOrientation](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/viewchangedeventargs/scrollorientation-property/llms-full.txt) is `None` for a change of the content, and `HorizontalScroll` or `VerticalScroll` when the view was scrolled; [ScrollDistance](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/viewchangedeventargs/scrolldistance-property/llms-full.txt) is then the distance, which is less than zero when the document was scrolled down or to the right.
- Changes of the content are collected in an update region. [GetUpdateRectangle](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getupdaterectangle-method/llms-full.txt) returns the smallest rectangle around it, and with `true` resets the region. Scrolling doesn't add to the region.

When the input position leaves the view, the view scrolls by itself and raises [AutoHScroll](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/autohscroll-event/llms-full.txt) or [AutoVScroll](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/autovscroll-event/llms-full.txt). A changed zoom factor raises [Zoomed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/zoomed-event/llms-full.txt). [View.GetCursorKind](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getcursorkind-method/llms-full.txt) returns the mouse cursor to show at a location, as a [CursorKind](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/cursorkind/enumeration/llms-full.txt) value.

#### The Changed Event Since Version 24.0

In version 24.0, the handler type of `View.Changed` changed from `System.EventHandler` to `ViewChangedEventHandler`, which passes the `ViewChangedEventArgs` described above. A handler written for an earlier version as `(object sender, EventArgs e)` doesn't compile any longer: change its second parameter to `ViewChangedEventArgs`.

### Connect Ruler Bars and a Status Bar

A `RulerBarViewGenerator` or a `StatusBarViewGenerator` connected to a `TextViewGenerator` follows its input position automatically. The following program renders the text, a horizontal ruler bar and a status bar:

```csharp
using System.Drawing;
using TXTextControl;
using TXTextControl.ServerVisualization;

using (RulerBarViewGenerator ruler = new RulerBarViewGenerator())
using (StatusBarViewGenerator statusBar = new StatusBarViewGenerator())
using (TextViewGenerator tx = new TextViewGenerator())
{
    // Each generator must be created before it is used
    ruler.Create();
    statusBar.Create();
    tx.Create();

    tx.Load("Documents/sample.docx", StreamType.WordprocessingML);
    tx.View.Size = new Size(12240, 7200);

    // Connect the bars with the text
    tx.RulerBar = ruler;
    tx.StatusBar = statusBar;

    statusBar.ShowPage = true;
    statusBar.ShowPageCounter = true;
    statusBar.ShowZoom = true;

    SaveImage(ruler.View, "ruler.png");
    SaveImage(tx.View, "text.png");
    SaveImage(statusBar.View, "statusbar.png");
}

static void SaveImage(View view, string fileName)
{
    if (view.GetImage(out byte[] png))
    {
        File.WriteAllBytes(fileName, png);
    }
}
```

The code works as follows:

- [TextViewGenerator.RulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/rulerbar-property/llms-full.txt) connects a horizontal ruler bar, [VerticalRulerBar](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/verticalrulerbar-property/llms-full.txt) a vertical one and [StatusBar](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/statusbar-property/llms-full.txt) a status bar. `null` disconnects them.
- The `Show` properties of the status bar choose its areas: [ShowPage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator/showpage-property/llms-full.txt), [ShowPageCounter](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator/showpagecounter-property/llms-full.txt), `ShowSection`, `ShowSectionCounter`, `ShowLine`, `ShowColumn`, `ShowLanguage`, `ShowKeyStates`, [ShowZoom](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator/showzoom-property/llms-full.txt) and `ShowZoomTrackBar`. The labels of the areas are set with `PageText`, `PageCounterText`, `SectionText`, `SectionCounterText`, `LineText` and `ColumnText`, and their font with `Font`.
- Each generator has its own `View`, and the images are drawn next to each other. The `Location` properties of [TextViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/location-property/llms-full.txt) and [RulerBarViewGenerator](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/location-property/llms-full.txt), in pixels, place the text image relative to the ruler image, so that the ruler marks line up with the text.

A ruler bar has further settings:

| Property | Sets |
|---|---|
| [Alignment](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/alignment-property/llms-full.txt) | `Top` for a horizontal ruler, `Left` for a vertical one |
| [ScaleUnit](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/scaleunit-property/llms-full.txt) | `Inch`, `Centimeter`, `Millimeter`, or `Auto` for inch or millimeter depending on the culture |
| [ReadOnly](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/readonly-property/llms-full.txt) | Whether the ruler only shows the formatting and doesn't change it |
| [EnablePageMargins](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/enablepagemargins-property/llms-full.txt) | Whether page margins can be set with the ruler |
| [FormulaMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator/formulamode-property/llms-full.txt) | Whether the ruler shows cell references in tables: `None` (the default), `Always`, `Auto` in cells with a formula, or `Fixed` relative to one cell |

`BorderStyle` sets the design of both bars. Their colors, set with `DisplayColors` as a [RulerBarViewGenerator.Colors](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/rulerbarviewgenerator-colors/llms-full.txt) or [StatusBarViewGenerator.Colors](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/statusbarviewgenerator-colors/llms-full.txt) object, are only used with the border style `ColorScheme`, and `ResetDisplayColors` restores the defaults. Both bars have a `Resolution` property like `TextViewGenerator`.

### Show Built-In Dialog Boxes

`TextViewGenerator.GetDialogBox` returns a `DialogViewGenerator` for one of the built-in dialog boxes, such as the font, paragraph, table or section dialog box. The parameter is a [DialogBoxKind](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/dialogboxkind-enumeration/llms-full.txt) value, and a second parameter selects a tab of the dialog boxes that have tabs. Two further overloads open the dialog box of a [PageNumberField](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/pagenumberfield/llms-full.txt) or of a [FormField](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/formfield/llms-full.txt).

```csharp
using TXTextControl;
using TXTextControl.ServerVisualization;

using (TextViewGenerator tx = new TextViewGenerator())
{
    tx.Create();
    tx.Load("Documents/sample.docx", StreamType.WordprocessingML);

    // Null if a dialog box returned before hasn't been disposed
    using (DialogViewGenerator dialog = tx.GetDialogBox(TextViewGenerator.DialogBoxKind.FontDialog))
    {
        if (dialog != null)
        {
            dialog.Closed += (sender, e) => Console.WriteLine("The dialog box was closed");

            if (dialog.View.GetImage(out byte[] png))
            {
                File.WriteAllBytes("font-dialog.png", png);
                Console.WriteLine($"{dialog.Caption}: font-dialog.png");
            }
        }
    }
}
```

The code works as follows:

- The dialog box has its own [View](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/view-property/llms-full.txt) and [UserInput](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/userinput-property/llms-full.txt). Clicks and key presses sent to it change the settings of the dialog box.
- [Caption](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/caption-property/llms-full.txt) is the title of the dialog box.
- [Closed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/closed-event/llms-full.txt) occurs when the user closes the dialog box with **OK** or **Cancel**.
- Dispose the `DialogViewGenerator` when the dialog box is closed. Until then, `GetDialogBox` returns `null`.

A dialog box that opens another one, such as a color dialog box, raises [ShowDialogBox](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/showdialogbox-event/llms-full.txt); its [ShowDialogBoxEventArgs.DialogBox](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/showdialogboxeventargs/dialogbox-property/llms-full.txt) is the generator of the child dialog box. A message for the user raises [ShowErrorMessage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/showerrormessage-event/llms-full.txt) with the [ErrorMessage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/showerrormessageeventargs/errormessage-property/llms-full.txt) and a [Caption](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/showerrormessageeventargs/caption-property/llms-full.txt), and [CaretStateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/dialogviewgenerator/caretstatechanged-event/llms-full.txt) reports where the caret of an input box is. `TextViewGenerator` has a [ShowDialogBox](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/showdialogbox-event/llms-full.txt) and a [ShowErrorMessage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/showerrormessage-event/llms-full.txt) event of its own, for dialog boxes and messages that user input opens in the text. [DialogUnit](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/dialogunit-property/llms-full.txt) sets the unit of sizes and distances in all dialog boxes.

### Control What the View Shows

Properties of `TextViewGenerator` decide how the document looks in its images and what users can do:

| Property | Sets |
|---|---|
| [ViewMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/viewmode-property/llms-full.txt) | `PageView` with pages, gaps and headers and footers, `Normal`, `FloatingText` or `SimpleControl` |
| [EditMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/editmode-property/llms-full.txt) | `Edit`, `ReadAndSelect` with the restrictions of [DocumentPermissions](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/documentpermissions-property/llms-full.txt), or `ReadOnly` |
| [CommentHighlightMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/commenthighlightmode-property/llms-full.txt) | Which commented texts are highlighted: `Activated` (the default) the one at the input position, `Always` all of them, `Never` none |
| [EditableRegionHighlightMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/editableregionhighlightmode-property/llms-full.txt) | The same for editable regions whose own highlight mode is `Auto` |
| [UserNames](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/usernames-property/llms-full.txt) | The users whose editable regions can be edited in a read-only document |
| [ControlChars](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/controlchars-property/llms-full.txt), [TextFrameMarkerLines](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/textframemarkerlines-property/llms-full.txt) | Whether control characters and the outlines of text frames without a border are shown |
| [DisplayColors](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/displaycolors-property/llms-full.txt) | The colors of the area around the pages, the page shadows, the header and footer labels and form fields, as a [TextViewGenerator.Colors](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator-colors/llms-full.txt) object |

`Auto` can't be set for `CommentHighlightMode` and `EditableRegionHighlightMode`. Whether conditional instructions are applied to form fields in a read-only document is set with [IsFormFieldValidationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/isformfieldvalidationenabled-property/llms-full.txt). Undo is available too, with [Undo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/undo-method/llms-full.txt), [Redo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/redo-method/llms-full.txt) and [BeginUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/beginundoaction-method/llms-full.txt) and [EndUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/endundoaction-method/llms-full.txt) to group changes into one undo step.

### Events of TextViewGenerator

Besides the events of `ServerTextControl`, a `TextViewGenerator` reports what user input does. The events fall into these groups:

| Group | Events |
|---|---|
| Drawing the user interface | [CaretStateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/caretstatechanged-event/llms-full.txt) with the location, size and visibility of the caret; [DocumentSizeChanged](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/documentsizechanged-event/llms-full.txt) with the size of the document in twips, for scroll bars; [TextContextMenuOpening](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/textcontextmenuopening-event/llms-full.txt) with the [MenuItem](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/menuitem/llms-full.txt) objects of a context menu after a right click; [DrawCombobox](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/drawcombobox-event/llms-full.txt), [DrawDateControl](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/drawdatecontrol-event/llms-full.txt), `RemoveCombobox` and `RemoveDateControl` for the controls of selection and date form fields; [DrawShape](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/drawshape-event/llms-full.txt) for additional parts during an interaction |
| Input position | [InputPositionChanged](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/inputpositionchanged-event/llms-full.txt), `InputParagraphChanged`, `InputFormattingStyleChanged`, and the `Entered` and `Left` events of text fields, subtextparts, editable regions, commented texts and tables of contents |
| Footnotes | [FootnoteReferenceMarkEntered](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/footnotereferencemarkentered-event/llms-full.txt), [FootnoteReferenceMarkLeft](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/footnotereferencemarkleft-event/llms-full.txt), [FootnoteSectionActivated](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/footnotesectionactivated-event/llms-full.txt) and [FootnoteSectionDeactivated](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/footnotesectiondeactivated-event/llms-full.txt), since version 32.0 |
| Parts of the document | `MainTextActivated`, `HeaderFooterActivated` and `HeaderFooterDeactivated`, `TextFrameActivated` and `TextFrameDeactivated` |
| Selected objects | `Selected` and `Deselected` events of images, text frames, charts, barcodes, drawings, signature fields and frames in general, and `FrameMoved` and `FrameSized` |
| Clicks | [TextFieldClicked](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/textfieldclicked-event/llms-full.txt), `SubTextPartClicked`, `SubTextPartDoubleClicked`, [HypertextLinkClicked](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/hypertextlinkclicked-event/llms-full.txt) and `DocumentLinkClicked` |
| Changes | [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/changed-event/llms-full.txt), `CharFormatChanged`, `ParagraphFormatChanged`, `PageFormatChanged`, `FormattingStyleChanged`, `FormattingStyleListChanged`, the `FormField` events for changed values and settings, `CommentChanged`, `CommentStateChanged`, `TrackedChangeChanged`, `TrackedChangeStateChanged` and `CannotTrackChange` |

The [ServerVisualization](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/llms-full.txt) namespace in the reference lists every member with its description.

### Next Steps

- [Pages](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/pages/llms-full.txt): render complete pages as SVG images.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/track-changes/llms-full.txt): read, accept and reject tracked changes, and record them with `TextViewGenerator`.
- [Document Protection](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/protection/llms-full.txt): mark the editable regions that `UserNames` unlocks.
- [Viewing and Printing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/viewing-printing/llms-full.txt) in the Document Editor: set the display colors in the browser.

---

## Nearby

- **Previous:** [XML Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/xml/llms-full.txt)
- **Next:** [Mail Merge and Reporting](https://docs.textcontrol.com/tx-text-control-dotnet-server/mail-merge/llms-full.txt)
