# Document Processing

> Build, convert and print documents in a WPF window with ServerTextControl and TextControl: a DOCX report, DOCX and PDF files and printing with PageRange.

- **Product:** TX Text Control .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for WPF > Getting Started > Document Processing
- **698 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/llms-full.txt

---

Not every document in a WPF application is typed by its user. Reports are assembled from data, files arrive in one format and must leave in another, and letters go to the printer without being opened. Three short tutorials handle these jobs with button handlers in the window of your first application, using `ServerTextControl`, the document engine without a user interface, next to the `TextControl` in XAML.

### Choose a Tutorial

| Tutorial | You learn to | Main members |
|---|---|---|
| [Create a Document Programmatically](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/create/llms-full.txt) | Build a report with formatted text, a table, an image and a header, save it as DOCX and show it in the editor | `ServerTextControl`, `Selection`, `Tables`, `Images`, `HeadersAndFooters` |
| [Save as DOCX and PDF](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/save-docx-pdf/llms-full.txt) | Export the editor's document and convert Word files in the background | `Save`, `StreamType`, `ServerTextControl` |
| [Print a Document](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/print/llms-full.txt) | Print with the print dialog and without one, print files with `ServerTextControl` and set the formatting printer | `Print`, `PageRange`, `PrintDocument`, `FormattingPrinter` |

### Before You Start

- Complete [Create Your First WPF Application](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/first-application/llms-full.txt). The tutorials add buttons to its window, next to the `TextControl` named `textControl1`.
- If `ServerTextControl` is new to you, read [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/overview/components/servertextcontrol/llms-full.txt) in the Overview first. Every instance has to be initialized with `Create` before use and disposed afterward.
- DOCX, DOC and PDF need the Professional or Enterprise edition. See [Editions and Feature Availability](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/overview/editions/llms-full.txt).

Each tutorial can be followed on its own. In the order of the table, they go from creating a document to saving it and printing it.

### Where WPF Differs

`ServerTextControl`, `Selection`, `SaveSettings` and the other classes that build and save documents are shared with TX Text Control .NET for Windows Forms, and code that uses them looks the same in both. The differences are in the window around it:

- **Buttons and handlers** are declared in XAML, and a `Click` handler receives `RoutedEventArgs`.
- **Dialogs** come from WPF: `Microsoft.Win32.OpenFileDialog` for files and the print dialog of WPF for printing.
- **Printing from the editor** uses the print system of WPF, with a printer name, a `PageRange` and a copy count. Printing with `ServerTextControl` uses a `PrintDocument`, which a .NET WPF project gets from the NuGet package *System.Drawing.Common*.

### After These Tutorials

- [Mail Merge](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/mail-merge/llms-full.txt): fill templates with data instead of building each document in code.
- [PDF Processing](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/pdf/llms-full.txt): PDF options, PDF forms and digital signatures.
- [Document Processing](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-processing/llms-full.txt): creating, loading, converting and printing documents in detail.

---

## In This Section

- [Create a Document Programmatically](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/create/llms-full.txt): Build a report in a WPF click handler with ServerTextControl: formatted text, a table with a header row, an image and a header, saved as DOCX and then shown.
- [Print a Document](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/print/llms-full.txt): Print from the WPF TextControl with the print dialog or a PageRange and printer, print files with ServerTextControl and PrintDocument, set FormattingPrinter.
- [Save as DOCX and PDF](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/save-docx-pdf/llms-full.txt): Export the document of the WPF TextControl as DOCX and PDF with Save, and convert DOC files to DOCX and PDF with ServerTextControl and an OpenFileDialog.

---

## Nearby

- **Previous:** [Load and Save Documents](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/load-save/llms-full.txt)
- **Next:** [Create a Document Programmatically](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-processing/create/llms-full.txt)
