Прочетете на английски Редактиране

Споделяне чрез


WorkflowView.PrintDocument Property

Definition

Gets the PrintDocument associated with the WorkflowView.

C#
public System.Drawing.Printing.PrintDocument PrintDocument { get; }

Property Value

A PrintDocument object that sends output to a printer.

Examples

The following example demonstrates how to retrieve the PrintDocument object, display a PrintDialog and associate the PrinterSettings that were selected by a user before printing the document.

C#
public void Print()
{
    System.Drawing.Printing.PrintDocument doc = this.workflowView.PrintDocument;
    PrintDialog dlg = new PrintDialog();
    if (dlg.ShowDialog() == DialogResult.OK)
    {
        doc.PrinterSettings = dlg.PrinterSettings;
        doc.Print();
    }
}

Remarks

Use the PrintDocument object to set the properties that describe how to print, and call the Print method to start the printing process.

Applies to

Продукт Версии
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1