Document Processing
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:
- Create an instance of
ServerTextControland callCreate. - Get the document: create it from pieces, or load it from a file, a byte array or a string.
- Change the document through the collections of
ServerTextControl:SelectionandParagraphsfor text,Tables,Images,TextFrames,HeadersAndFooters,Sections,FormFields,Comments,TrackedChangesand the other collections for the other elements. - 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 to | Read |
|---|---|
| Create and dispose instances, set the page format of a new document and assemble documents from pieces | Creating Documents |
| Load uploads and password-protected files, control the import or read document information | Loading Documents |
| Convert many documents, save HTML with stylesheets, make PDF files smaller or leave out comments | Saving and Converting Documents |
| Select, find, replace and format text | Text |
| Align and space paragraphs, create paragraph styles and lists, write right to left | Paragraphs |
| Fill tables from data, format cells, calculate totals, split tables and convert tables to text | Tables |
| Insert, position, find and extract images | Images |
| Add text frames, read and remove drawings | Text Frames and Shapes |
| Add barcodes and QR codes, or work with charts | Charts and Barcodes |
| Add headers, footers and page numbers, or give parts of a document their own page layout | Headers and Footers, Sections |
| Insert footnotes or generate a table of contents | Footnotes, Tables of Contents |
| Work with text fields, Word fields, links and bookmarks | Fields |
| Mark ranges of text with a name and data | Subtext Parts |
| Create fillable forms, read their values and flatten them | Form Fields |
| Read and fill MS Word forms with content controls | Content Controls |
| Read, add and remove comments | Comments |
| Accept and reject tracked changes | Track Changes |
| Mark editable regions of protected documents | Document Protection |
| Check spelling and hyphenate words | Spell Checking and Hyphenation |
| Count pages, find the page of text and render pages as SVG or multipage TIFF | Pages |
| Find the differences between two documents | Document Comparison |
| Send documents to a printer | Printing |
| React to loaded, created and deleted elements | Events |
| Validate form field values and change fields based on other fields | Conditional Instructions |
| Load XML files with their DTD and CSS and edit their elements | XML Documents |
Render the view, rulers, status bar and dialog boxes of a ServerTextControl as images | Server Visualization |
Where to Start
- Creating Documents: the lifecycle of an instance and the structure of a new document.
- Loading Documents and Saving and Converting Documents: get documents in and out.
- The page of the element you need, from the table above.