TX Text Control .NET Server

Document Processing Examples

Topic

ServerTextControl works without a user interface, so its samples are mostly console applications and Web APIs: they load a document, change or analyze it and save the result. The online demos show the same operations with a viewer or editor for the result, and an interactive lab lets you change the code of a document and see the pages it produces. Most of the sample projects target the current version, 34.0, with the Core engine.

Online Demos

ExampleWhat it showsWhere
Word formatsA DOCX document converted on the server to PDF, RTF or HTMLMS Word Formats
MarkdownMarkdown loaded into an editable document and the edited document saved back as Markdown with TXTextControl.Markdown.CoreMarkdown Import and Export
CSV to PDFCSV data turned into a formatted, paginated table in a PDF documentCSV to PDF
SelectionsFormatting text with the current selection compared with prepared Selection objects, with the pages rendered as SVGSelection API
Paragraph formattingAlignment, spacing, indents, frames and page breaks of paragraphsParagraph Format API
StylesParagraph styles created, applied, inherited and changedStylesheet API
FieldsFields created, read, updated and removedApplication Fields API
Headers and footersHeaders and footers per section, first-page variants and page number fieldsHeaders and Footers API
TablesTables created, filled, formatted, resized and calculatedTables API
RedactionConfidential text replaced by redaction graphics in the Document EditorDocument Redaction

The demos of the Interactive Coding section are a guided lab: you change the C# code of the example and see the result, within a set of allowed members. The demos of document analysis, such as classification and sanitization, are listed in AI Examples.

Sample Projects

These samples target version 34.0 with the Core engine:

ExampleWhat it showsWhere
Tracked changesA report of all tracked changes of a DOCX document with type, author and time, and the changes accepted or rejected, as described in Inspect and Process Track Changes in DOCX Documents with TX Text Control with .NET C#. .NET 10TXTextControl.TrackChanges.Core
Track changes reviewAn ASP.NET Core application that lists the documents with tracked changes, shows each change with its author and time, filters them, accepts or rejects them one by one or in bulk and previews their place on the page as SVG, as described in Building a Modern Track Changes Review Workflow in ASP.NET Core C#. .NET 10TXTextControl.TrackChanges.Review
Tables to CSVAll tables of a document exported as CSV, with header rows and custom separators, as described in Export Document Tables to CSV in .NET C#. .NET 8TXTextControl.TableToCSV
CSV to a tableCSV data converted into a table and saved as PDF, as described in Convert CSV to PDF in .NET C#. .NET 10TXTextControl.Core.CSVToTable
HTML to MarkdownAll HTML files of a folder converted to Markdown with TXTextControl.Markdown.Core, as described in Converting HTML to Markdown in C# .NET. .NET 10TXTextControl.HtmlToMD
SSRS reportsRDL report definitions of SQL Server Reporting Services converted into DOCX or TX Text Control templates with merge fields and blocks, with a conversion report, as described in Convert SSRS RDL Reports to DOCX and TX Text Control Templates in .NET C#. .NET 10TXTextControl.Rdl2Tx
Template dependenciesFonts, linked images, merge fields, merge blocks and form fields of templates checked before a deployment, for example from Windows to Linux, as described in Check TX Text Control Template Dependencies Before Deployment. .NET 10TXTextControl.Check.Dependencies
Styles from regular expressionsInline styles applied to text that matches regular expressions from JSON rules, then exported as PDF, as described in RegEx Based Inline Styling in TX Text Control Using JSON Rules. .NET 10TXTextControl.Core.RegExToStyle
Personal dataA DOCX document scanned for personal and health data with rules and regular expressions, with the findings and recommendations printed, as described in A Rule-Based PHI and PII Risk Scanner for Documents Using C# .NET. .NET 8TXTextControl.Core.PHIScanner

Linux, Docker and Web APIs

These samples were written for version 33.0 with the Core engine:

ExampleWhat it showsWhere
DOCX to PDF from JavaA .NET console tool that converts DOCX to PDF, called from a Java application in one Docker container, as described in Converting Office Open XML (DOCX) to PDF in JavaTXTextControl.Core.Java.Convert
Markdown to PDFA command-line converter from Markdown to PDF for Linux and Windows, as described in Convert Markdown to PDF in a Console Application on Linux and Windows. It references a prerelease of TXTextControl.Markdown.CoreTXTextControl.Markdown.Md2Pdf
PDF generation Web APIAn ASP.NET Core Web API on Linux with a clean architecture that merges templates and returns PDF documents, deployable with Docker, as described in Designing a Maintainable PDF Generation Web API in ASP.NET Core (Linux) C# with Clean Architecture and TX Text ControlTXTextControl.Core.MailMerge.API

Older Samples

ExampleWhat it showsWhere
RedactionA class that replaces marked text with images of the same size before the document is saved as PDF, as described in True Document and PDF Text Redaction in .NET C#. The repository contains the class onlyRedaction
Comparison by imagesTwo documents compared pixel by pixel as page images, as described in Document Comparison using Image-Based Pixel Matching in .NET C#. Version 32.0 with the Classic engineTXTextControl.Compare.Pixel

Blog Articles With Code

ExampleWhat it showsWhere
A console application on LinuxServerTextControl and MailMerge in a .NET 8 console application in a Linux containerGetting Started: ServerTextControl and MailMerge in a .NET 8 Console Application on Linux with Docker and WSL
Visual Studio Code on LinuxA console application created with Visual Studio Code that creates a PDFCreating a .NET Console Application with Visual Studio Code and TX Text Control (on Linux)
DOCX documents on LinuxDOCX documents created in code in a Linux containerHow to Programmatically Create MS Word DOCX Documents with .NET C# on Linux
Faster generationDocuments built about twice as fast with prepared Selection objects instead of formatting the live selection after inserting the textSpeed Up Document Generation by Factor 2 Using Selection Objects in .NET C#
Text replacement in large filesPlaceholders replaced in hundreds of large DOCX filesHigh-Performance Text Replacement in Large DOCX Files using C# .NET

Next Steps