TX Text Control .NET for WPF

Print Method

Method|Introduced in 16.0
Namespace
TXTextControl.WPF
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.WPF.dll from the private NuGet feed or Text Control Offline Packages

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.

public void Print(string docName, bool useLastPrinterSettings);
ParameterDescription
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.

public void Print(string docName, PageRange pageRange, int copyCount, Collation collation);
ParameterDescription
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.

public void Print(string docName, string printerName, PageRange pageRange, int copyCount, Collation collation);
ParameterDescription
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.

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