Document Processing Examples
Code that loads, changes, analyzes or converts documents runs on the WPF TextControl or on a ServerTextControl, which works without a user interface and is part of the WPF package as well. Only a few samples are WPF projects. Most document processing samples of Text Control are console applications written for TX Text Control .NET Server, and their ServerTextControl code carries over to a WPF application.
WPF Samples
| Example | What it shows | Where |
|---|---|---|
| Spreadsheet formulas | Formulas compatible with Excel in the cells of a table, which recalculate when a value changes. Version 32.0, the .NET Framework 4.8 and .NET 6, C# and Visual Basic | TXSamples_WPF_CSharp, folder Howto\Spreadsheet |
| XML files | XML files loaded with a style sheet and a document type definition, including a file that isn't valid. Version 32.0, the .NET Framework 4.8 and .NET 6 | TXSamples_WPF_CSharp, folder Howto\XMLBasics |
The print preview sample, which renders the pages as images, is listed in Document Editor Examples. The setup installs the samples of the official collection for the current version; GitHub Examples describes how to update the copies on GitHub.
ServerTextControl Samples
These projects, most of them console applications, were written for TX Text Control .NET Server 34.0 on .NET 8 or .NET 10. To reuse their code in a WPF project, reference TXTextControl.TextControl.WPF.SDK instead of their package:
| Example | What it shows | Where |
|---|---|---|
| Tracked changes | A report of all tracked changes of a DOCX document, then each change accepted or rejected, as described in Inspect and Process Track Changes in DOCX Documents with TX Text Control with .NET C# | TXTextControl.TrackChanges.Core |
| Tables to CSV | All tables of a document exported as CSV files, as described in Export Document Tables to CSV in .NET C# | TXTextControl.TableToCSV |
| CSV to a table | CSV data turned into a table and saved as PDF, as described in Convert CSV to PDF in .NET C# | TXTextControl.Core.CSVToTable |
| Reporting Services reports | RDL reports converted into DOCX documents and templates, as described in Convert SSRS RDL Reports to DOCX and TX Text Control Templates in .NET C# | TXTextControl.Rdl2Tx |
| Template dependencies | Fonts, images, merge fields, merge blocks and form fields of templates checked before deployment, as described in Check TX Text Control Template Dependencies Before Deployment | TXTextControl.Check.Dependencies |
| Styles from regular expressions | Inline styles applied by rules with regular expressions, read from JSON, as described in RegEx Based Inline Styling in TX Text Control Using JSON Rules | TXTextControl.Core.RegExToStyle |
| Personal data | A document scanned for personal and health data with rules and regular expressions, as described in A Rule-Based PHI and PII Risk Scanner for Documents Using C# .NET | TXTextControl.Core.PHIScanner |
Next Steps
- Document Processing: create, load, change and save documents in code.
- Mail Merge Examples: documents created from templates and data.
- GitHub Examples: run a sample and update it to the current version.