TX Text Control .NET Server

Print Method

Method|Introduced in 14.0
Namespace
TXTextControl.DocumentServer
Package
TXTextControl.TextControl.ASP.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages
Not in
TXTextControl.TextControl.Core.SDK

Description

Prints the merged document.

Syntax

Print(PrintDocument)

Prints the merged document. It uses the settings of the specified PrintDocument.

public void Print(PrintDocument printDocument);
ParameterDescription
printDocument

Specifies an instance of the PrintDocument class. Text Control uses the following settings of this object:

SettingMeaning
DocumentNameSpecifies the document's name.
PrintControllerSpecifies the document's print controller.
PrinterSettings.FromPageThe first page to print.
PrinterSettings.ToPageThe last page to print.
PrinterSettings.CopiesThe number of copies to print.
PrinterSettings.CollateSpecifies how the printed pages are sorted.
PrinterSettings.PrinterNameSpecifies the name of the printer.
PrinterSettings.PrintToFileSpecifies whether the printed pages are saved in a file.
PrinterSettings.PrintRangeSpecifies the range of pages to print.
DefaultPageSettings.ColorSpecifies whether the printed pages are printed colored.

Print(string, string, short, bool)

Prints the merged document with specific settings for the document name, the printer name, the number of copies and whether it should be collated or not.

public void Print(string docName, string printerName, short copyCount, bool collate);
ParameterDescription
docName

Specifies the document's name.

printerName

Specifies the name of the printer to which the output is sent.

copyCount

Specifies the number of copies to print.

collate

Collates output by printing every page of the first copy, then every page of the second copy, and so on. When collate is set to false, the printer prints every copy of the first page, then every copy of the second page, and so on.

Examples

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

mailMerge.Print("CustomerName", "CustomerName", 1, true);
Console.WriteLine("Mail Merge is ready for use.");