TX Text Control .NET Server

Examples

Topic

Working code is often the fastest way into a new topic. The samples below range from a console chat with a local model to a complete web application with the Document Editor, a document server for MCP clients and skills for AI coding assistants. Each table links the source code, and the other pages of AI Integration explain the concepts behind them.

Samples that use the TX Text Control AI preview, version 0.1.0-beta.3 at the time of writing, need a GGUF model and an inference runtime that you provide. Older blog samples call OpenAI's hosted API and need an OpenAI API key.

TX Text Control AI Samples

All ten samples are in the repository txtextcontrol-ai-samples, which Text Control AI describes how to build and run.

ExampleWhat it showsWhere
LocalChatA minimal console loop that answers prompts with a local model and prints the model and runtime detailssamples/LocalChat
LocalStreamingA generated article streamed to the console as the model writes itsamples/LocalStreaming
LocalStructuredOutputAn invoice extracted into a typed record as JSONsamples/LocalStructuredOutput
LocalToolCallingA model that calls a function of the applicationsamples/LocalToolCalling
McpChatA console document assistant that discovers and calls the tools of the MCP document serversamples/McpChat
MinimalWebA small web page with the browser client of TXTextControl.AI.AspNetCore: progress, answers and downloadssamples/MinimalWeb
WebDocumentAssistantThe complete web application with Chat, Document Studio, runtime administration, knowledge collections, exports and the Document Editorsamples/WebDocumentAssistant
AiServiceAI integration, runtime administration and knowledge hosted separately from the website behind an authenticated APIsamples/AiService
MinimalMcpHostThe smallest host of the MCP document server, for local developmentsamples/MinimalMcpHost
McpServerThe full MCP document server with administration pages, style settings and diagnosticssamples/McpServer

MCP Servers and Agent Skills

ExampleWhat it showsWhere
TX Text Control MCP Document ServerAn ASP.NET Core server that exposes document operations built on ServerTextControl as MCP tools: sessions, creating, inspecting, editing, converting and exporting documentsTXTextControl.MCPDocumentServer
Document Editor skillsAgent Skills that teach AI coding assistants to integrate the Document Editor in ASP.NET Core, Angular and React and to use its JavaScript APItxtextcontrol-document-editor-skills
ServerTextControl skillsAgent Skills for server-side tasks such as mail merge, tables, images, headers and footers, lists, fields, subtext parts, tracked changes and PDF signingtxtextcontrol-servertextcontrol-skills
Text Control MCP ServerA read-only MCP endpoint with tools that give AI coding assistants access to the blog, product information and API documentationText Control MCP Server

MCP Document Server describes the document server, and AI Coding Assistants the Text Control MCP Server and the skills.

Blog Samples With a Repository

ExampleWhat it showsWhere
ChatGPT in the Document EditorRephrasing selected text and generating formatted content with OpenAI, as described in Integrating OpenAI ChatGPT with TX Text Control to Rephrase Content and Using OpenAI to Generate Content in TX Text Controltx-chatgpt-ai-integration
PDF classificationA console application that imports a PDF and lets OpenAI assign one tag from a predefined set, as described in PDF Document Classification with OpenAI and TX Text Control in C#TXTextControl.Server.OpenAI.Classification
Chat PDFQuestions about a PDF, answered from the matching text chunk with OpenAI functions, as described in Chat PDF - A Generative AI Application for PDF Documents using TX Text Control and OpenAI Functions in C#TXTextControl.OpenAI.AskPDF
Explaining tracked changesThe tracked changes and comments of a contract explained by OpenAI as JSON, as described in Explaining Contract Tracked Changes Automatically Using .NET C# and AITXTextControl.AI.TrackedChanges
Classification without AIRule-based, explainable document classification with ServerTextControl as an alternative to a model, as described in Document Classification Without AI: Deterministic, Explainable, and Built for Production in C# .NETTXTextControl.Document.Classification

Blog Articles With Code

ExampleWhat it showsWhere
Local LLM console chatA streaming console chat with history and a local model, written for version 0.1.0-beta.1 of the previewRunning a Local LLM in .NET C# with TX Text Control AI
Document conversion without tokensDOCX to Markdown and Markdown to PDF in code instead of with a modelStop Burning Tokens to Convert your Documents
Descriptions for accessible PDF documentsAlternative texts for images, links and tables generated with OpenAI before a PDF/UA exportAutomating PDF/UA Accessibility with AI: Describing DOCX Documents Using TX Text Control and LLMs
Legal reviewSections of a contract reviewed by a model, with the suggestions inserted as tracked changesTransforming Legal Review with AI and TX Text Control: A Smarter, Faster Approach to Legal Document Processing in .NET C#
Document analysis without a modelClassification, table extraction, form field mapping and sanitization as deterministic online samplesFrom Classification to Data Extraction: New Document Analysis Samples