VisualsToXpsDocument.WriteAsync Method

Definition

Writes a Visualasynchronously to an XpsDocument or a PrintQueue.

Overloads

WriteAsync(Visual)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue.

WriteAsync(Visual, Object)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes additional information that the caller wants to pass to an event handler.

WriteAsync(Visual, PrintTicket)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes a PrintTicket.

WriteAsync(Visual, PrintTicket, Object)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue; also includes a PrintTicket and any additional information that the caller wants to pass to an event handler.

WriteAsync(Visual)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue.

public:
 override void WriteAsync(System::Windows::Media::Visual ^ visual);
public override void WriteAsync (System.Windows.Media.Visual visual);
override this.WriteAsync : System.Windows.Media.Visual -> unit
Public Overrides Sub WriteAsync (visual As Visual)

Parameters

visual
Visual

The Visual that is written.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Write(Visual).

Applies to

WriteAsync(Visual, Object)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes additional information that the caller wants to pass to an event handler.

public:
 override void WriteAsync(System::Windows::Media::Visual ^ visual, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Media.Visual visual, object userSuppliedState);
override this.WriteAsync : System.Windows.Media.Visual * obj -> unit
Public Overrides Sub WriteAsync (visual As Visual, userSuppliedState As Object)

Parameters

visual
Visual

The Visual that is written.

userSuppliedState
Object

An object that contains data that the caller wants to pass to the WritingCompleted event handler.

Applies to

WriteAsync(Visual, PrintTicket)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue and includes a PrintTicket.

public:
 override void WriteAsync(System::Windows::Media::Visual ^ visual, System::Printing::PrintTicket ^ printTicket);
public override void WriteAsync (System.Windows.Media.Visual visual, System.Printing.PrintTicket printTicket);
override this.WriteAsync : System.Windows.Media.Visual * System.Printing.PrintTicket -> unit
Public Overrides Sub WriteAsync (visual As Visual, printTicket As PrintTicket)

Parameters

visual
Visual

The Visual that is written.

printTicket
PrintTicket

A PrintTicket that represents the default printing preferences for the document.

Remarks

This method does not validate or modify the specified printTicket for a particular PrintQueue. If necessary, use the MergeAndValidatePrintTicket method to create a PrintTicket that is specific to the PrintQueue and is valid for a specified printer.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by Write(Visual, PrintTicket).

Applies to

WriteAsync(Visual, PrintTicket, Object)

Writes a Visual asynchronously to an XpsDocument or a PrintQueue; also includes a PrintTicket and any additional information that the caller wants to pass to an event handler.

public:
 override void WriteAsync(System::Windows::Media::Visual ^ visual, System::Printing::PrintTicket ^ printTicket, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Media.Visual visual, System.Printing.PrintTicket printTicket, object userSuppliedState);
override this.WriteAsync : System.Windows.Media.Visual * System.Printing.PrintTicket * obj -> unit
Public Overrides Sub WriteAsync (visual As Visual, printTicket As PrintTicket, userSuppliedState As Object)

Parameters

visual
Visual

The Visual that is written.

printTicket
PrintTicket

A PrintTicket that represents the default printing preferences for the document.

userSuppliedState
Object

An object that contains the data that the caller wants to pass to the WritingCompleted event handler.

Remarks

This method does not validate or modify the specified printTicket for a particular PrintQueue. If necessary, use the MergeAndValidatePrintTicket method to create a PrintTicket that is specific to the PrintQueue and is valid for a specified printer.

Applies to