VisualsToXpsDocument.WriteAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
- 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
- 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
- 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.