# TextControl.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:** 16.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.Print Method
- **1152 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/print-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/print-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/print-method/llms-full.txt

---

### Description

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

### Syntax

#### Print(string, bool)

Opens the standard print dialog to get printer settings and prints the document.

```csharp
public void Print(string docName, bool useLastPrinterSettings);
```

```vbnet
Public Sub Print(docName As String, useLastPrinterSettings As Boolean)
```

| Parameter | Description |
|---|---|
| docName | Specifies the document's name. |
| useLastPrinterSettings | If this parameter is set to true, the dialog box is initialized with the user settings of the previous call. |

#### Print(string, PageRange, int, Collation)

Prints a Text Control document with the standard printer using the specified page range, copy count and collation settings.

```csharp
public void Print(string docName, PageRange pageRange, int copyCount, Collation collation);
```

```vbnet
Public Sub Print(docName As String, pageRange As PageRange, copyCount As Integer, collation As Collation)
```

| Parameter | Description |
|---|---|
| docName | Specifies the document's name. |
| pageRange | Specifies a System.Windows.Controls.PageRange structure specifying the range of pages to print. |
| copyCount | Specifies the number of copies to print. |
| collation | Specifies a System.Printing.Collation member specifying whether the printer collates output. |

#### Print(string, string, PageRange, int, Collation)

Prints a Text Control document with the specified printer using the specified page range, copy count and collation settings.

```csharp
public void Print(string docName, string printerName, PageRange pageRange, int copyCount, Collation collation);
```

```vbnet
Public Sub Print(docName As String, printerName As String, pageRange As PageRange, copyCount As Integer, collation As Collation)
```

| Parameter | Description |
|---|---|
| docName | Specifies the document's name. |
| printerName | Specifies the name of the printer to which the output is sent. |
| pageRange | Specifies a System.Windows.Controls.PageRange structure specifying the range of pages to print. |
| copyCount | Specifies the number of copies to print. |
| collation | Specifies a System.Printing.Collation member specifying whether the printer collates output. |

### Examples

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

```csharp
textControl.Print("CustomerName", true);
Console.WriteLine("Text Control is ready for use.");
```

```vbnet
textControl.Print("CustomerName", True)
Console.WriteLine("Text Control is ready for use.")
```

---

## Nearby

- **Previous:** [TextControl.PointToDocument Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pointtodocument-method/llms-full.txt)
- **Next:** [TextControl.Redo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/redo-method/llms-full.txt)
