TX Text Control .NET Server

Document Processing

Topic

Reports generated overnight, contracts converted to PDF, uploads checked before they're stored: document processing happens on the server, in code, without a user interface. ServerTextControl creates, loads, changes, converts and saves documents in console applications, services and ASP.NET Core, with a part of its API for each element of a document, from text and paragraphs to tables, images, fields, form fields, comments and tracked changes.

If you haven't used ServerTextControl yet, start with Getting Started: Document Processing. The ServerTextControl page in the Overview explains what the component is and where it runs.

How You Work With Documents on the Server

Code that processes a document goes through the same steps:

  1. Create an instance of ServerTextControl and call Create.
  2. Get the document: create it from pieces, or load it from a file, a byte array or a string.
  3. Change the document through the collections of ServerTextControl: Selection and Paragraphs for text, Tables, Images, TextFrames, HeadersAndFooters, Sections, FormFields, Comments, TrackedChanges and the other collections for the other elements.
  4. Save the result in the format you need, to a file, a byte array or a string, and dispose the instance.

The examples use the Core package TXTextControl.TextControl.Core.SDK, which runs on Windows and Linux. The code is the same with the Classic package TXTextControl.TextControl.ASP.SDK, which only runs on Windows. Where the two differ, as for printing, page images, XML documents and the DOC format, the difference is noted.

Find the Right Page

If you want toRead
Create and dispose instances, set the page format of a new document and assemble documents from piecesCreating Documents
Load uploads and password-protected files, control the import or read document informationLoading Documents
Convert many documents, save HTML with stylesheets, make PDF files smaller or leave out commentsSaving and Converting Documents
Select, find, replace and format textText
Align and space paragraphs, create paragraph styles and lists, write right to leftParagraphs
Fill tables from data, format cells, calculate totals, split tables and convert tables to textTables
Insert, position, find and extract imagesImages
Add text frames, read and remove drawingsText Frames and Shapes
Add barcodes and QR codes, or work with chartsCharts and Barcodes
Add headers, footers and page numbers, or give parts of a document their own page layoutHeaders and Footers, Sections
Insert footnotes or generate a table of contentsFootnotes, Tables of Contents
Work with text fields, Word fields, links and bookmarksFields
Mark ranges of text with a name and dataSubtext Parts
Create fillable forms, read their values and flatten themForm Fields
Read and fill MS Word forms with content controlsContent Controls
Read, add and remove commentsComments
Accept and reject tracked changesTrack Changes
Mark editable regions of protected documentsDocument Protection
Check spelling and hyphenate wordsSpell Checking and Hyphenation
Count pages, find the page of text and render pages as SVG or multipage TIFFPages
Find the differences between two documentsDocument Comparison
Send documents to a printerPrinting
React to loaded, created and deleted elementsEvents
Validate form field values and change fields based on other fieldsConditional Instructions
Load XML files with their DTD and CSS and edit their elementsXML Documents
Render the view, rulers, status bar and dialog boxes of a ServerTextControl as imagesServer Visualization

Where to Start

  1. Creating Documents: the lifecycle of an instance and the structure of a new document.
  2. Loading Documents and Saving and Converting Documents: get documents in and out.
  3. The page of the element you need, from the table above.