# Printing

> Fix printing problems of TX Text Control .NET for WPF: disabled printing, ignored print dialog settings, breaks that differ from the screen, PrintDocument jobs.

- **Product:** TX Text Control .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for WPF > Troubleshooting > Printing
- **1204 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/printing/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/printing/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/printing/llms-full.txt

---

When printing from TX Text Control .NET for WPF doesn't do what you expect, TX Text Control usually shows no error: the document prints the wrong pages, looks different on paper, or doesn't print at all. The WPF `TextControl` prints with the print system of WPF, while `ServerTextControl` and `MailMerge` print with a `PrintDocument` of .NET, and the problems of the two ways differ. [Printing and Print Preview](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/printing/llms-full.txt) describes printing when everything works.

### Printing Is Disabled or Does Nothing

The **Print** command of your application is grayed out or doesn't print, while other documents print.

Whether a document can be printed depends on the document. [CanPrint](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/canprint-property/llms-full.txt) tells you, and its value depends on [DocumentPermissions.AllowPrinting](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentpermissions/allowprinting-property/llms-full.txt) and the current [EditMode](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editmode-property/llms-full.txt). `AllowPrinting` is `true` by default. A PDF document can also restrict printing: when the permissions of a loaded PDF don't allow printing, an application should disable its print command.

1. Check `CanPrint` before you call [Print](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/print-method/llms-full.txt), and enable or disable your print command with it.
2. If the document is protected, check the edit mode and the [DocumentPermissions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/documentpermissions-property/llms-full.txt) that the document sets.
3. For a PDF document, check [LoadSettings.DocumentAccessPermissions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/loadsettings/documentaccesspermissions-property/llms-full.txt) after loading. If you have the owner password, load the document with it in [MasterPassword](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/loadsavesettingsbase/masterpassword-property/llms-full.txt): then all permissions are granted.

### The Settings of the Print Dialog Are Ignored

You show the `PrintDialog` of WPF, and the user chooses a page range, the number of copies or collation, but the document prints with other settings.

`Print` doesn't read the settings of a `PrintDialog` that your code shows. It has overloads that take the printer, the page range, the number of copies and the collation, and these values must be passed from the dialog. The overload with a document name and a Boolean value shows the standard print dialog itself.

Pass the name of the printer queue, the page range, and the copy count and collation of the print ticket from the dialog to `Print`, as [Connect the WPF Print Dialog](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/printing/#connect-the-wpf-print-dialog) shows. In a .NET Framework project, `PrintQueue` and `PrintTicket` need references to *System.Printing.dll* and *ReachFramework.dll*.

### Line and Page Breaks on Paper Differ From the Screen

The printed document breaks lines or pages in other places than the editor shows.

TX Text Control formats a document with the text dimensions of the printer that [FormattingPrinter](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formattingprinter-property/llms-full.txt) names, and printing on another printer, or formatting with `Display`, can move the breaks. Set `FormattingPrinter` to the printer you print on, or name a printer that every machine has, as [The Layout Depends on the Printer](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/fonts/#the-layout-depends-on-the-printer) explains.

### A PrintDocument Prints All Pages Instead of Some

[ServerTextControl.Print](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/print-method/llms-full.txt) or [MailMerge.Print](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/mailmerge/print-method/llms-full.txt) prints every page, although you set `FromPage` and `ToPage` of the `PrintDocument`.

These methods print with a `PrintDocument` of .NET, and a page range takes effect only when the `PrintRange` of its printer settings is `PrintRange.SomePages`.

1. Set `PrinterSettings.PrintRange` of the `PrintDocument` to `PrintRange.SomePages`.
2. Set `FromPage` and `ToPage`, and pass the `PrintDocument` to `Print`, as [Print a File in the Background](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-processing/printing/#print-a-file-in-the-background) shows.

### A Status Dialog Appears While Printing a PrintDocument

While a `ServerTextControl` or `MailMerge` prints, a dialog box of .NET shows the page being printed, for example:

```text
Page 5 of document
```

The default print controller of .NET shows this dialog, and TX Text Control uses the print controller of the `PrintDocument` you pass.

1. Assign a new `StandardPrintController` to the `PrintController` of the `PrintDocument`.
2. Pass the `PrintDocument` to `Print`.

### The Editor Starts Slowly

Creating the first `TextControl` or `ServerTextControl` takes seconds, especially on machines with a network or wireless default printer.

When TX Text Control initializes, it asks the default printer for its dimensions, even when `FormattingPrinter` is `Display`, and a printer in energy saving mode or on a slow network delays the start. Set the static property `DefaultFormattingPrinter` of `TXTextControl.WPF.TextControl` and `ServerTextControl` when the application starts, as [Start Without Waiting for a Printer](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/performance/best-practices/#start-without-waiting-for-a-printer) shows, and compare the start time.

### Related Pages

- [Printing and Print Preview](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/printing/llms-full.txt): printing from the editor.
- [Printing](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-processing/printing/llms-full.txt): printing without a user interface.
- [Fonts and Document Layout](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/fonts/llms-full.txt): text that looks different on paper for other reasons.

---

## Nearby

- **Previous:** [DPI and Scaling](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/dpi-scaling/llms-full.txt)
- **Next:** [Document Conversion](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/conversion/llms-full.txt)
