# ServerTextControl.Print Method

> Prints a Text Control document or a part of a document.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 12.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > ServerTextControl.Print Method
- **855 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/print-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/print-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/print-method/llms-full.txt

---

### Description

Prints a Text Control document or a part of a document.

### Syntax

#### Print(PrintDocument)

Prints the document using the printer settings of the specified PrintDocument.

```csharp
public void Print(PrintDocument printDocument);
```

```vbnet
Public Sub Print(printDocument As PrintDocument)
```

| Parameter | Description |
|---|---|
| printDocument | Specifies an instance of the PrintDocument class. The following settings of the PrintDocument object are used:  \| Setting \| Meaning \| \| DocumentName \| Specifies the document's name. \| \| PrintController \| Specifies the document's print controller. \| \| PrinterSettings.FromPage \| The first page to print. \| \| PrinterSettings.ToPage \| The last page to print. \| \| PrinterSettings.Copies \| The number of copies to print. \| \| PrinterSettings.Collate \| Specifies how the printed pages are sorted. \| \| PrinterSettings.PrinterName \| Specifies the name of the printer. \| \| PrinterSettings.PrintToFile \| Specifies whether the printed pages are saved in a file. \| \| PrinterSettings.PrintRange \| Specifies the range of pages to print. \| \| DefaultPageSettings.Color \| Specifies whether the printed pages are printed colored. \| |
|---|

#### Print(int, PrintPageEventArgs)

Prints a single page. This method can be called from the PrintPage event handler.

```csharp
public void Print(int page, PrintPageEventArgs ppe);
```

```vbnet
Public Sub Print(page As Integer, ppe As PrintPageEventArgs)
```

| Parameter | Description |
|---|---|
| page | Specifies a page number to print. |
| ppe | Specifies the event arguments of the print document's PrintPage event. |

### Examples

The following example prints the current document. The created object is then available to the surrounding document workflow.

```csharp
textControl.Print(new System.Drawing.Printing.PrintDocument());
Console.WriteLine("Server Text Control is ready for use.");
```

```vbnet
textControl.Print(New System.Drawing.Printing.PrintDocument())
Console.WriteLine("Server Text Control is ready for use.")
```

---

## Nearby

- **Previous:** [ServerTextControl.ParagraphStyles Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/paragraphstyles-property/llms-full.txt)
- **Next:** [ServerTextControl.ResetBackColor Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/resetbackcolor-method/llms-full.txt)
