# TextControl.Print Method

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

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

---

### Description

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

### Syntax

#### Print(string)

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

```csharp
public void Print(string docName);
```

```vbnet
Public Sub Print(docName As String)
```

| Parameter | Description |
|---|---|
| docName | Specifies the document's name. |

#### 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. Text Control uses the following settings of this object:  \| 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("CustomerName");
Console.WriteLine("Text Control is ready for use.");
```

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

---

## Nearby

- **Previous:** [TextControl.PermanentControlChars Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/permanentcontrolchars-property/llms-full.txt)
- **Next:** [TextControl.PrintPreview Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/printpreview-method/llms-full.txt)
