# Text Rendering in ActiveReports

## Content

ActiveReports.NET v20.2.2 uses different technologies for text measurement, layout, and drawing depending on the report type, compatibility mode, and output target.

### Text Rendering Engines

ActiveReports uses the following text rendering engines:

#### GDI+ (Windows GDI+)

**GDI+** (Graphics Device Interface Plus) is the legacy Windows graphics API used by earlier .NET ActiveReports versions for text measurement and rendering.
GDI+ has these characteristics:

* **Windows-only**: GDI+ is available only on Windows.
* **OS-defined text wrapping**: Word breaking and text wrapping are determined by the Windows GDI+ engine rather than by ActiveReports.
* **Legacy compatibility support**: In ActiveReports, GDI+ is available for [Section reports](/activereportsnet/docs/report-authors/reporttypes/section-report-type) when [SectionDocument.CompatibilityMode](/activereportsnet/api/MESCIUS.ActiveReports/GrapeCity.ActiveReports.Document.SectionDocument.CompatibilityMode.html) is set to `GDI`.

When a Section report runs in GDI mode, text wrapping follows Windows GDI+ behavior. As a result, line breaks can differ from both Unicode-based line breaking and the whitespace-based wrapping behavior used in ActiveReports 2 (COM/VB6).

#### Document Solutions for Imaging .NET

[Document Solutions for Imaging .NET](https://developer.mescius.com/document-solutions/dot-net-imaging-api/docs/online/overview) provides the `TextLayout` class - a cross-platform text layout engine used by [RDLX-based reports](/activereportsnet/docs/report-authors/reporttypes/rdl-report-type).
Document Solutions for Imaging `TextLayout` is used by:

* [RDLX-based report](/activereportsnet/docs/report-authors/reporttypes/rdl-report-type). Always.
* [Section report](/activereportsnet/docs/report-authors/reporttypes/section-report-type). When [SectionDocument.CompatibilityMode](/activereportsnet/api/MESCIUS.ActiveReports/GrapeCity.ActiveReports.Document.SectionDocument.CompatibilityMode.html) is set to `CrossPlatform`.

Document Solutions for Imaging `TextLayout` provides:

* **Cross-platform support** across Windows, Linux, and macOS
* **Configurable line breaking** through the `LineBreakingAlgorithm` setting in the [ActiveReports.config](/activereportsnet/docs/devops/customization/configure-ar)
* **More consistent layout behavior** across supported platforms and output targets that use the Document Solutions for Imaging pipeline

The [LineBreakingAlgorithm](/activereportsnet/docs/devops/customization/configure-ar#runtime-settings) setting supports these values:

* **`Unicode`** (default): Uses standard Unicode line-breaking rules. Characters such as `%` and `-` are treated as valid break opportunities.
* **`Legacy`**: Approximates the text-wrapping behavior of earlier .NET ActiveReports versions that used Windows GDI+ for text measurement.
* **`Simplified`**: Allows wrap opportunities only at whitespace boundaries, producing wrapping behavior closer to ActiveReports 2 (COM/VB6).

### Compatibility Mode for Section Reports

For [Section reports](/activereportsnet/docs/report-authors/reporttypes/section-report-type), the [SectionDocument.CompatibilityMode](/activereportsnet/api/MESCIUS.ActiveReports/GrapeCity.ActiveReports.Document.SectionDocument.CompatibilityMode.html) property determines which text rendering engine is used.

| Mode | Engine | Platform | `LineBreakingAlgorithm` applies |
| ---- | ------ | -------- | ----------------------------- |
| **`GDI`** | Windows GDI+ | Windows only | ❌ No |
| **`CrossPlatform`** (default) | Document Solutions `TextLayout` | Windows, Linux, macOS | ✅ Yes |

If `CompatibilityMode` is set to `GDI`, text wrapping is controlled by Windows GDI+, so `LineBreakingAlgorithm` has no effect. If it is set to `CrossPlatform`, text layout is handled by Document Solutions for Imaging `TextLayout`, and the selected `LineBreakingAlgorithm` value is applied.
[RDLX-based reports](/activereportsnet/docs/report-authors/reporttypes/rdl-report-type) do not expose the `CompatibilityMode` property. They always use Document Solutions for Imaging `TextLayout`, so `LineBreakingAlgorithm` applies whenever the Document Solutions for Imaging rendering pipeline is used.

### Differences in line-breaking behavior

Different engines can produce different line breaks for the same text, especially when the text contains characters such as `%`, `-`, `:`, or `?`.

* **GDI+** follows Windows GDI+ line-breaking behavior.
* **Document Solutions for Imaging** **with `Unicode`** uses Unicode line-breaking rules, which treat characters such as `%` and `-` as valid break opportunities.
* **Document Solutions for Imaging** **with `Simplified`** breaks lines only at whitespace boundaries, keeping strings such as `+10%USt:33,92` together as a single unbreakable token.

These differences are especially relevant when you migrate reports from earlier ActiveReports versions.

### Rendering Pipelines

A **rendering pipeline** is the sequence of processes that transforms a report definition (`.rdlx` or `.rpx`) into a viewable format, such as HTML, SVG, or PDF. The rendering pipeline varies by viewer and output format. It also determines which text layout engine performs line wrapping and, therefore, whether the [`LineBreakingAlgorithm`](/activereportsnet/docs/devops/customization/configure-ar){:target="_blank" rel="nofollow"} setting applies.
ActiveReports.NET provides different rendering pipelines that correspond to the rendering technology used by the report.

| Pipeline | Used by | Engine | Notes |
| -------- | ------- | ------ | ----- |
| [Direct2D](/activereportsnet/docs/developers/printing) (default) | RDLX-based reports, Section reports in `CrossPlatform` mode | Direct2D / Document Solutions | Provides faster rendering and improved text quality. Does not support GDI-specific printer APIs. |
| [GDI](/activereportsnet/docs/developers/printing) | Section reports in `GDI`mode | Windows GDI+ | Required when the application depends on GDI-specific printer APIs such as `PrinterSettings.PrinterResolutions` or `PrintDocument.QueryPageSettings`. |

The GDI rendering pipeline is legacy and is used only when explicitly enabled.

### Web Viewer Rendering

#### JS Viewer and Blazor Viewer

In the [JS Viewer](/activereportsnet/docs/developers/create-applications/js-viewer-application){:target="_blank" rel="nofollow"} and [Blazor Viewer](/activereportsnet/docs/developers/create-applications/blazor-viewer-application){:target="_blank" rel="nofollow"}, text layout depends on the rendering format specified by the `renderFormat` option during viewer initialization:

* **SVG:** The report is rendered as a vector image. Line wrapping is handled by the [Document Solutions for Imaging](https://www.grapecity.com/document-solutions/dot-net-imaging-api){:target="_blank" rel="nofollow"} `TextLayout` engine; therefore, `LineBreakingAlgorithm` applies.
* **HTML:** The report is rendered by using standard HTML elements. Line wrapping is handled by the browser’s CSS text-layout engine, including the `word-break` and `overflow-wrap` properties. Therefore, `LineBreakingAlgorithm` does not apply.

#### ASP.NET WebViewer

The [ASP.NET WebViewer](/activereportsnet/docs/developers/create-applications/aspnet-webviewer-application) is a server-side Web Forms control for .NET Framework 4.7.2–4.8.1. Its `ViewerType` property determines the rendering pipeline:

* `HTMLViewer` (default): Renders the report through the Document Solutions `TextLayout` engine and sends interactive HTML/SVG content to the browser. The `LineBreakingAlgorithm` setting applies.
* `RawHTML`: Renders the report as one continuous HTML page. The browser’s CSS text-layout engine determines line wrapping. The `LineBreakingAlgorithm` setting does not apply.
* `AcrobatReader`: Renders the report as a PDF document and displays it in the Acrobat Reader browser plug-in. The Document Solutions `TextLayout` engine determines line wrapping during PDF rendering. The `LineBreakingAlgorithm` setting applies.

| Viewer and render format | Text layout engine | `<LineBreakingAlgorithm` applies |
| ------------------------ | ------------------ | ------------------------------ |
| JS Viewer or Blazor Viewer; `renderFormat: "html"` | Browser CSS text-layout engine | ❌ No |
| JS Viewer or Blazor Viewer, `renderFormat: "svg"`  | Document Solutions for Imaging `TextLayout` | ✅ Yes |
| ASP.NET WebViewer, `ViewerType: HTMLViewer` | Document Solutions for Imaging `TextLayout` | ✅ Yes |
| ASP.NET WebViewer, `ViewerType: RawHTML` | Browser CSS text-layout engine | ❌ No |
| ASP.NET WebViewer, `ViewerType: AcrobatReader` | Document Solutions for Imaging `TextLayout` | ✅ Yes |

To apply `LineBreakingAlgorithm` when viewing an RDLX-based report in the JS Viewer or Blazor Viewer, set the `renderFormat` option to `svg`. No change is required for Section reports.

### Rendering Engine by Scenario

| Report type | CompatibilityMode | Desktop viewer | Web viewer (HTML) | Web viewer (SVG) | Printing (Direct2D) | Printing (GDI) |
| ----------- | ----------------- | -------------- | ----------------- | ---------------- | ------------------- | -------------- |
| Section | GDI | GDI+ | Browser | GDI+ | ❌ | GDI+ |
| Section | CrossPlatform | Document Solutions for Imaging | Browser | Document Solutions for Imaging | Document Solutions for Imaging | — |
| RDLX-based | Not applicable | Document Solutions for Imaging | Browser | Document Solutions for Imaging | Document Solutions for Imaging | — |

### See also

[Configure ActiveReports using Config File](/activereportsnet/docs/devops/customization/configure-ar)
[Configuring Text Rendering](/activereportsnet/docs/developers/create-applications/web-viewer-and-web-designer-middlewares/jsvieweraspnet-middleware/middleware-configuration-options/configuring-text-rendering)
[Print Reports](/activereportsnet/docs/developers/printing)
[RDLX Reports](/activereportsnet/docs/report-authors/reporttypes/rdl-report-type)
[Section Reports](/activereportsnet/docs/report-authors/reporttypes/section-report-type)
[Document Solutions for Imaging](https://developer.mescius.com/document-solutions/dot-net-imaging-api/docs/online/overview)