This repository contains a sample plugin for Text Control DS Server that demonstrates how to:
- Implement a controller-based plugin using the
TXTextControl.DocumentServices.Plugin.Abstractions
package - Register custom middleware
- Read configuration settings
- Register plugin-specific services via dependency injection
- Serve a simple HTML configuration page
The sample plugin:
- Registers a controller at
/plugin/hello
- Returns a greeting text from configuration
- Logs each request to
/plugin/hello
using custom middleware - Uses
IPlugin
lifecycle methods for setup and logging - Provides a basic HTML configuration page at
/plugin-ui/sample-plugin
usingMapGet
- Build the plugin:
dotnet build
- Create a subfolder inside the
Plugins/
folder of your DS Server installation (e.g.Plugins/SamplePlugin/
). - Copy the resulting
TXTextControl.DocumentServices.SamplePlugin.dll
into that subfolder:
Plugins/
└── SamplePlugin/
└── TXTextControl.DocumentServices.SamplePlugin.dll
- Optionally extend your DS Server
appsettings.json
:
"SamplePlugin": {
"Greeting": "Hello from the sample plugin!"
}
- Restart DS Server.
After deployment, you can access the plugin endpoint:
GET http://<your-ds-server>/plugin/hello
You should receive the configured greeting string, and the request will be logged by the plugin's middleware.
The plugin also provides a basic web-based configuration page at:
http://<your-ds-server>/plugin-ui/sample-plugin
This page is rendered using MapGet(...)
in the plugin's ConfigureMiddleware
method, demonstrating how to serve a simple HTML UI from a plugin.
HelloPlugin.cs
— Implements the IPlugin interfaceControllers/HelloController.cs
— A minimal API controllerServices/GreetingState.cs
— A singleton service registered by the plugin
This sample is provided under the MIT License. See LICENSE.md for details.
Text Control DS Server is a powerful on-premise backend for generating, viewing, editing, and signing documents — complete with extensive mail merge and reporting capabilities — accessible via REST APIs or integrated custom logic through plugins like this one. Try it out today and see how it can enhance your document processing workflows!