DS Server 4.1.0: Extend DS Server with Custom Plug-ins
With the release of DS Server 4.1.0, you can now extend DS Server with your own custom plug-ins to add new functionality or modify existing behavior. This article provides an overview of how to create and deploy custom plug-ins for DS Server.

We are happy to announce the release of DS Server version 4.1.0, which offers a new way to enhance the capabilities of Text Control DS Server: A plug-in architecture that enables you to create and deploy external assemblies directly within your DS Server environment.
This new feature allows you to go beyond the built-in APIs and seamlessly integrate your own logic, routes, services, and middleware into the DS Server lifecycle.
Why Plug-ins?
Every application has unique requirements. Sometimes, you need to add a custom API endpoint, integrate external services, or perform custom startup and shutdown tasks. Until now, these use cases required external wrapping of the DS Server.
The new plug-in feature solves this by letting you:
- Register custom ASP.NET Core controllers to expose new API endpoints
- Add middleware to intercept requests for logging, metrics, or custom authentication
- Register services into DS Server's dependency injection container
- Hook into lifecycle events with startup and shutdown logic
This makes DS Server more than just a document backend; it's a fully extensible platform. In combination with TX Text Control .NET Server, you can offer the functionality of the TX Text Control API in the form of a DS Server plug-in. Additionally, you can offer plug-ins to other users, enabling them to incorporate your custom functionality into DS Server.
The IPlugin Interface
At the heart of this feature is the IPlugin interface, which defines how plug-ins integrate with DS Server:
namespace TXTextControl.DocumentServices.Plugin.Abstractions;
public interface IPlugin {
string Name { get; }
string Description { get; }
string Version { get; }
string UIBasePath => null; // Optional, for plugins with a web UI (e. g. /plugin-ui/config)
void ConfigureServices(IServiceCollection services, PluginContext context) { }
void ConfigureMiddleware(WebApplication app, PluginContext context) { }
void OnStart(IServiceProvider services, PluginContext context) { }
void OnStop() { }
}
This provides access to the DS Server configuration, base directory, and runtime environment via the PluginContext.
public class PluginContext {
public string DsServerVersion { get; set; } = default!;
public string BaseDirectory { get; set; } = default!;
public IConfiguration Configuration { get; set; } = default!;
}
Hello, World! Plug-in
Let's create a simple "Hello, World!" plug-in that adds a new API endpoint to DS Server:
- A GreetingState service holds a configurable greeting.
- A controller exposes an endpoint at /plugin/hello.
- Middleware logs requests to this endpoint.
- The plug-in prints its greeting when DS Server starts.
-
Create a new class library project.
dotnet new classlib -n MyFirstPlugin cd MyFirstPlugin
-
Add the abstraction package.
dotnet add package TXTextControl.DocumentServices.Plugin.Abstractions
-
Define a service to hold config state.
public class GreetingState { public string Greeting { get; set; } = "Hello (default)"; }
This service will be used to store and manage the greeting message.
-
Create a controller to handle requests.
using Microsoft.AspNetCore.Mvc; namespace MyFirstPlugin; [ApiController] [Route("plugin/[controller]")] public class HelloController : ControllerBase { private readonly GreetingState m_state; public HelloController(GreetingState state) { m_state = state; } [HttpGet] public string Get() => m_state.Greeting; }
This controller will respond to requests at /plugin/hello.
-
Implement the plug-in class.
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using TXTextControl.DocumentServices.Plugin.Abstractions; namespace MyFirstPlugin; public class HelloPlugin : IPlugin { public string Name => "MyFirstPlugin"; public string Description => "Adds a /plugin/hello endpoint and logs requests."; public string Version => "1.0.0"; public void ConfigureServices(IServiceCollection services, PluginContext context) { // Retrieve the greeting from the configuration and register it as a singleton service. // This is just an example. Implementing ConfigureServices is optional. var greeting = context.Configuration["MyFirstPlugin:Greeting"] ?? "Hello (default)"; services.AddSingleton(new GreetingState { Greeting = greeting }); } public void ConfigureMiddleware(WebApplication app, PluginContext context) { // Register a middleware to log requests to the /plugin/hello endpoint. // This is also just an example. Implementing ConfigureMiddleware is optional. app.Use(async (ctx, next) => { if (ctx.Request.Path.StartsWithSegments("/plugin/hello")) { var logger = ctx.RequestServices.GetRequiredService<ILogger<HelloPlugin>>(); logger.LogInformation("MyFirstPlugin intercepted request to /plugin/hello"); } await next(); }); } public void OnStart(IServiceProvider services, PluginContext context) { // This method is called when the plugin is started. You can use this to // initialize resources or perform startup logic. Implementing OnStart is optional. var logger = services.GetService<ILogger<HelloPlugin>>(); var state = services.GetService<GreetingState>(); logger?.LogInformation("Plugin started. Greeting: {Greeting}", state?.Greeting); } public void OnStop() { // Cleanup logic if needed. This is also optional. } }
This class implements the IPlugin interface. It reads the greeting text from the configuration and registers a middleware to log requests.
After compiling, simply drop the DLL into the Plugins folder of your DS Server installation and restart the service. Then, your custom logic is live.
Configuration Support
Plug-ins can also support custom configuration sections in the DS Server appsettings.json file. This allows you to easily adjust settings without recompiling the plug-in.
For example, you can define a configuration section for the GreetingState service:
"MyFirstPlugin": {
"Greeting": "Howdy from DS Server!"
}
Deployment in 3 Steps
Creating and deploying a DS Server plug-in is straightforward:
- Implement the IPlugin interface in your class.
- Compile the plug-in into a DLL.
- Drop the DLL into the Plugins folder of your DS Server installation and restart the service.
The full sources of the sample plug-in can be found in our GitHub repository.
A More Powerful DS Server
The new plug-in system transforms DS Server into much more than just a REST API for document processing. It is now a customizable platform for your business needs, whether that means advanced logging, integration with external systems, or new APIs running alongside DS Server's built-in endpoints.
Get Started Today
Download DS Server 4.0 today and try it in your own environment. We have updated our documentation to include Linux-specific installation guides and deployment best practices for Docker and cloud platforms.
If you would like to test this on your own server, you can download a new on-premises trial version.
All licenses in the online store have been updated. Owners of a valid subscription can download the new installation package from the store.
Updated Packages
When testing DS Server 4.1.0, please make sure to use the updated packages for .NET Core, Angular, and React.
NuGet (.NET Core)
The following NuGet packages have been released and are compatible with DS Server 4.0:
- TXTextControl.DocumentServices.DocumentEditor
https://www.nuget.org/packages/TXTextControl.DocumentServices.DocumentEditor/4.1.0 - TXTextControl.DocumentServices.DocumentProcessing
https://www.nuget.org/packages/TXTextControl.DocumentServices.DocumentProcessing/4.1.0 - TXTextControl.DocumentServices.DocumentViewer
https://www.nuget.org/packages/TXTextControl.DocumentServices.DocumentViewer/4.1.0 - TXTextControl.DocumentServices.Admin
https://www.nuget.org/packages/TXTextControl.DocumentServices.Admin/4.1.0
npm (Angular)
The following npm Angular packages have been released and are compatible with DS Server 4.0:
- @txtextcontrol/tx-ng-ds-document-editor
https://www.npmjs.com/package/@txtextcontrol/tx-ng-ds-document-editor/v/4.1.0 - @txtextcontrol/tx-ng-ds-document-viewer
https://www.npmjs.com/package/@txtextcontrol/tx-ng-ds-document-viewer/v/4.1.0 - @txtextcontrol/tx-ng-ds-document-processing
https://www.npmjs.com/package/@txtextcontrol/tx-ng-ds-document-processing/v/4.1.0
npm (React)
The following npm React packages have been released and are compatible with DS Server 4.0:
- @txtextcontrol/tx-react-ds-document-editor
https://www.npmjs.com/package/@txtextcontrol/tx-react-ds-document-editor/v/4.1.0 - @txtextcontrol/tx-react-ds-document-viewer
https://www.npmjs.com/package/@txtextcontrol/tx-react-ds-document-viewer/v/4.1.0
See the change log for a complete list of changes.
We are excited to see what you will create with DS Server 4.1.0! As always, we value your feedback and are here to support you every step of your development journey.
Download and Fork This Sample on GitHub
We proudly host our sample code on github.com/TextControl.
Please fork and contribute.
Requirements for this sample
- DS Server 4.1.0
Related Posts
Getting Started Video Tutorial: Using DS Server with Docker
This video tutorial demonstrates how to quickly set up a Docker container with your own on-premises DS Server backend. You'll learn how to spin up the container in just seconds and configure it to…
Unleash Document Automation Superpowers at NDC Oslo 2025
Join us at NDC Oslo 2025 to discover how to supercharge your document automation with the latest features and best practices. At our booth, you can explore the latest advances in document…
Announcing the Official DS Server Docker Image on Docker Hub
The official DS Server Docker image is now available on Docker Hub. This makes it easier to deploy the DS server in a containerized environment and manage and scale your applications. Based on the…
Introducing DS Server 4.0: Linux-Ready and Container-Friendly
We are excited to announce the release of DS Server 4.0, our latest major update that makes your document processing workflows more flexible and powerful. This release marks two significant…
Low Code vs. High Code: Differences between TX Text Control and DS Server
Low-code platforms help developers build applications faster with less implementation. This article explains the differences between the fully programmable library TX Text Control and the low code…