XpsDocumentWriter.WriteAsync Method

Definition

Writes asynchronously to the XpsDocument or PrintQueue that created the XpsDocumentWriter.

Overloads

WriteAsync(FixedPage, Object)

Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue.

WriteAsync(FixedPage, PrintTicket)

Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(Visual, Object)

Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue.

WriteAsync(Visual, PrintTicket)

Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocumentSequence, PrintTicket, Object)

Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocument, PrintTicket, Object)

Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(FixedPage, PrintTicket, Object)

Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(Visual, PrintTicket, Object)

Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocumentSequence, PrintTicket)

Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(DocumentPaginator, PrintTicket, Object)

Writes asynchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocumentSequence, Object)

Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocumentSequence)

Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocument, Object)

Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue.

WriteAsync(DocumentPaginator, PrintTicket)

Writes asynchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(DocumentPaginator, Object)

Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue.

WriteAsync(String, XpsDocumentNotificationLevel)

Writes asynchronously a specified XPS document with notification option to the target XpsDocument or PrintQueue.

WriteAsync(Visual)

Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue.

WriteAsync(FixedPage)

Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocument)

Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue.

WriteAsync(DocumentPaginator)

Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue.

WriteAsync(String)

Writes asynchronously a specified XPS document to the target XpsDocument or PrintQueue.

WriteAsync(FixedDocument, PrintTicket)

Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue.

WriteAsync(FixedPage, Object)

Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedPage ^ fixedPage, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.FixedPage fixedPage, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.FixedPage * obj -> unit

Parameters

fixedPage
FixedPage

The page that is written.

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

WriteAsync(FixedPage, PrintTicket)

Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedPage ^ fixedPage, System::Printing::PrintTicket ^ printTicket);
public override void WriteAsync (System.Windows.Documents.FixedPage fixedPage, System.Printing.PrintTicket printTicket);
override this.WriteAsync : System.Windows.Documents.FixedPage * System.Printing.PrintTicket -> unit

Parameters

fixedPage
FixedPage

The page that is written.

printTicket
PrintTicket

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

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.

WriteAsync(Visual, Object)

Writes asynchronously a specified Visual to the target XpsDocument or PrintQueue.

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

Parameters

visual
Visual

The Visual that is written.

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

Remarks

To batch write a Visual, use VisualsToXpsDocument.

WriteAsync(Visual, PrintTicket)

Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue.

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

Parameters

visual
Visual

The Visual that is written.

printTicket
PrintTicket

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

Remarks

To batch write a Visual, use VisualsToXpsDocument.

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.

WriteAsync(FixedDocumentSequence, PrintTicket, Object)

Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocumentSequence ^ fixedDocumentSequence, System::Printing::PrintTicket ^ printTicket, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence, System.Printing.PrintTicket printTicket, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.FixedDocumentSequence * System.Printing.PrintTicket * obj -> unit

Parameters

fixedDocumentSequence
FixedDocumentSequence

The set of documents to be written.

printTicket
PrintTicket

A PrintTicket that represents the default printing preferences for the set of documents.

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

Remarks

WriteAsync writes a set of documents asynchronously to the XpsDocument or PrintQueue that created the XpsDocumentWriter. The data that is written includes a PrintTicket and additional information that the caller wants to pass to an event handler.

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument or a set of FixedDocument elements to the existing sequence.

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.

WriteAsync(FixedDocument, PrintTicket, Object)

Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocument ^ fixedDocument, System::Printing::PrintTicket ^ printTicket, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.FixedDocument fixedDocument, System.Printing.PrintTicket printTicket, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.FixedDocument * System.Printing.PrintTicket * obj -> unit

Parameters

fixedDocument
FixedDocument

The document that is written.

printTicket
PrintTicket

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

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument to the set.

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.

WriteAsync(FixedPage, PrintTicket, Object)

Writes asynchronously a specified FixedPage together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedPage ^ fixedPage, System::Printing::PrintTicket ^ printTicket, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.FixedPage fixedPage, System.Printing.PrintTicket printTicket, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.FixedPage * System.Printing.PrintTicket * obj -> unit

Parameters

fixedPage
FixedPage

The page that is written.

printTicket
PrintTicket

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

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

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.

WriteAsync(Visual, PrintTicket, Object)

Writes asynchronously a specified Visual together with a PrintTicket to the target XpsDocument or PrintQueue.

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

Parameters

visual
Visual

The Visual that is written.

printTicket
PrintTicket

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

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

Remarks

For writing multiple Visual elements, use VisualsToXpsDocument.

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.

WriteAsync(FixedDocumentSequence, PrintTicket)

Writes asynchronously a specified FixedDocumentSequence together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocumentSequence ^ fixedDocumentSequence, System::Printing::PrintTicket ^ printTicket);
public override void WriteAsync (System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence, System.Printing.PrintTicket printTicket);
override this.WriteAsync : System.Windows.Documents.FixedDocumentSequence * System.Printing.PrintTicket -> unit

Parameters

fixedDocumentSequence
FixedDocumentSequence

The set of documents that are written.

printTicket
PrintTicket

A PrintTicket that represents the default printing preferences for the set of documents.

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument or a set of FixedDocument elements to the existing set.

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.

WriteAsync(DocumentPaginator, PrintTicket, Object)

Writes asynchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::DocumentPaginator ^ documentPaginator, System::Printing::PrintTicket ^ printTicket, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator, System.Printing.PrintTicket printTicket, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.DocumentPaginator * System.Printing.PrintTicket * obj -> unit

Parameters

documentPaginator
DocumentPaginator

An object that contains a pointer to unpaginated source material; also contains methods for paginating the material.

printTicket
PrintTicket

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

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

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.

WriteAsync(FixedDocumentSequence, Object)

Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocumentSequence ^ fixedDocumentSequence, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.FixedDocumentSequence * obj -> unit

Parameters

fixedDocumentSequence
FixedDocumentSequence

The set of documents that are written.

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument or a set of FixedDocument elements to the existing set.

WriteAsync(FixedDocumentSequence)

Writes asynchronously a specified FixedDocumentSequence to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocumentSequence ^ fixedDocumentSequence);
public override void WriteAsync (System.Windows.Documents.FixedDocumentSequence fixedDocumentSequence);
override this.WriteAsync : System.Windows.Documents.FixedDocumentSequence -> unit

Parameters

fixedDocumentSequence
FixedDocumentSequence

The set of documents that is written.

Examples

The following example shows how to use this method to write to an XPS document.

private void SaveMultipleFixedContentDocumentsAsync(
             XpsDocumentWriter xpsdw, FixedDocumentSequence fds)
{
    _xpsdwActive = xpsdw;

    xpsdw.WritingCompleted +=
        new WritingCompletedEventHandler(AsyncSaveCompleted);

    xpsdw.WritingProgressChanged +=
        new WritingProgressChangedEventHandler(AsyncSavingProgress);

    // Write the FixedDocumentSequence as a
    // collection of documents asynchronously.
    xpsdw.WriteAsync(fds);
}
Private Sub SaveMultipleFixedContentDocumentsAsync(ByVal xpsdw As XpsDocumentWriter, ByVal fds As FixedDocumentSequence)
    _xpsdwActive = xpsdw

    AddHandler xpsdw.WritingCompleted, AddressOf AsyncSaveCompleted

    AddHandler xpsdw.WritingProgressChanged, AddressOf AsyncSavingProgress

    ' Write the FixedDocumentSequence as a
    ' collection of documents asynchronously.
    xpsdw.WriteAsync(fds)
End Sub

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument or a set of FixedDocument elements to the existing set.

WriteAsync(FixedDocument, Object)

Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocument ^ fixedDocument, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.FixedDocument fixedDocument, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.FixedDocument * obj -> unit

Parameters

fixedDocument
FixedDocument

The document that is written.

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument to the set.

WriteAsync(DocumentPaginator, PrintTicket)

Writes asynchronously paginated content from a specified DocumentPaginator together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::DocumentPaginator ^ documentPaginator, System::Printing::PrintTicket ^ printTicket);
public override void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator, System.Printing.PrintTicket printTicket);
override this.WriteAsync : System.Windows.Documents.DocumentPaginator * System.Printing.PrintTicket -> unit

Parameters

documentPaginator
DocumentPaginator

An object that contains a pointer to unpaginated source material and also contains methods for paginating the material.

printTicket
PrintTicket

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

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.

WriteAsync(DocumentPaginator, Object)

Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::DocumentPaginator ^ documentPaginator, System::Object ^ userSuppliedState);
public override void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator, object userSuppliedState);
override this.WriteAsync : System.Windows.Documents.DocumentPaginator * obj -> unit

Parameters

documentPaginator
DocumentPaginator

An object that contains a pointer to unpaginated source material; also contains methods for paginating the material.

userSuppliedState
Object

A user-specified object to identify and associate with the asynchronous operation.

WriteAsync(String, XpsDocumentNotificationLevel)

Writes asynchronously a specified XPS document with notification option to the target XpsDocument or PrintQueue.

public:
 void WriteAsync(System::String ^ documentPath, System::Windows::Xps::XpsDocumentNotificationLevel notificationLevel);
public void WriteAsync (string documentPath, System.Windows.Xps.XpsDocumentNotificationLevel notificationLevel);
override this.WriteAsync : string * System.Windows.Xps.XpsDocumentNotificationLevel -> unit
Public Sub WriteAsync (documentPath As String, notificationLevel As XpsDocumentNotificationLevel)

Parameters

documentPath
String

The path of the source document.

notificationLevel
XpsDocumentNotificationLevel

An indication of whether notification is enabled.

Remarks

When notificationLevel is disabled, the XpsDocumentWriter copies the serialized XPS document to the target XpsDocument or PrintQueue that created the XpsDocumentWriter. When notificationLevel is enabled, the XpsDocumentWriter first deserializes the document, next reserializes it, and then writes it to the target with progress notifications as each page is output.

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds the FixedDocument elements in the source to the sequence of FixedDocument elements in the target XpsDocument or PrintQueue.

If notificationLevel is specified as ReceiveNotificationEnabled, notifications are produced only when the document is serialized, not printed. To receive notifications the document must be reserialized. When a document is reserialized all content from the Package that is not required to be preserved by the XML Paper Specification is removed. The reserialization will also remove all extensions from the FixedPage markup, including any extended XPS content.

If notificationLevel is specified as ReceiveNotificationDisabled the document will not be reserialized and any extended content will be preserved, even when printed.

By design this WriteAsync method does not call the WritingPrintTicketRequired event.

WriteAsync(Visual)

Writes asynchronously a specified Visual to the target XpsDocument or 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

Parameters

visual
Visual

The Visual that is written.

Examples

The following example shows how to use this method to write a Visual to an XPS document.

private void SaveVisualAsync(XpsDocumentWriter xpsdw, Visual v)
{
    _xpsdwActive = xpsdw;

    xpsdw.WritingCompleted +=
        new WritingCompletedEventHandler(AsyncSaveCompleted);

    xpsdw.WriteAsync(v);    // Write visual to single page.
}
Private Sub SaveVisualAsync(ByVal xpsdw As XpsDocumentWriter, ByVal v As Visual)
    _xpsdwActive = xpsdw

    AddHandler xpsdw.WritingCompleted, AddressOf AsyncSaveCompleted

    xpsdw.WriteAsync(v) ' Write visual to single page.
End Sub

Remarks

To batch write a Visual, use VisualsToXpsDocument.

WriteAsync(FixedPage)

Writes asynchronously a specified FixedPage to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedPage ^ fixedPage);
public override void WriteAsync (System.Windows.Documents.FixedPage fixedPage);
override this.WriteAsync : System.Windows.Documents.FixedPage -> unit

Parameters

fixedPage
FixedPage

The page that is written.

WriteAsync(FixedDocument)

Writes asynchronously a specified FixedDocument to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocument ^ fixedDocument);
public override void WriteAsync (System.Windows.Documents.FixedDocument fixedDocument);
override this.WriteAsync : System.Windows.Documents.FixedDocument -> unit

Parameters

fixedDocument
FixedDocument

The document that is written.

Examples

The following example shows how to use this method to write to an XPS document.

private void SaveSingleFixedContentDocumentAsync(
             XpsDocumentWriter xpsdw, FixedDocument fd)
{
    _xpsdwActive = xpsdw;

    xpsdw.WritingCompleted +=
        new WritingCompletedEventHandler(AsyncSaveCompleted);

    // Write the FixedDocument as a document.
    xpsdw.WriteAsync(fd);
}
Private Sub SaveSingleFixedContentDocumentAsync(ByVal xpsdw As XpsDocumentWriter, ByVal fd As FixedDocument)
    _xpsdwActive = xpsdw

    AddHandler xpsdw.WritingCompleted, AddressOf AsyncSaveCompleted

    ' Write the FixedDocument as a document.
    xpsdw.WriteAsync(fd)
End Sub

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument to the set.

WriteAsync(DocumentPaginator)

Writes asynchronously paginated content from a specified DocumentPaginator to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::DocumentPaginator ^ documentPaginator);
public override void WriteAsync (System.Windows.Documents.DocumentPaginator documentPaginator);
override this.WriteAsync : System.Windows.Documents.DocumentPaginator -> unit

Parameters

documentPaginator
DocumentPaginator

An object that contains a pointer to unpaginated source material and also contains methods for paginating the material.

Examples

The following example shows how to use this method to write to an XPS document.

private void SaveSingleFlowContentDocumentAsync(
             XpsDocumentWriter xpsdw, DocumentPaginator idp)
{
    _xpsdwActive = xpsdw;

    xpsdw.WritingCompleted +=
        new WritingCompletedEventHandler(AsyncSaveCompleted);

    // Write the IDP as a document.
    xpsdw.WriteAsync(idp);
}
Private Sub SaveSingleFlowContentDocumentAsync(ByVal xpsdw As XpsDocumentWriter, ByVal idp As DocumentPaginator)
    _xpsdwActive = xpsdw

    AddHandler xpsdw.WritingCompleted, AddressOf AsyncSaveCompleted

    ' Write the IDP as a document.
    xpsdw.WriteAsync(idp)
End Sub

WriteAsync(String)

Writes asynchronously a specified XPS document to the target XpsDocument or PrintQueue.

public:
 void WriteAsync(System::String ^ documentPath);
public void WriteAsync (string documentPath);
override this.WriteAsync : string -> unit
Public Sub WriteAsync (documentPath As String)

Parameters

documentPath
String

The path of the source document.

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds the FixedDocument elements in the source to the set of FixedDocument elements in the target XpsDocument or PrintQueue.

This WriteAsync method will reserialize the specified XPS document which will remove all content from the Package that is not required to be preserved by the XML Paper Specification. The reserialization will also remove all extensions from the FixedPage markup, including any extended XPS content.

By design this WriteAsync method does not call the WritingPrintTicketRequired event.

WriteAsync(FixedDocument, PrintTicket)

Writes asynchronously a specified FixedDocument together with a PrintTicket to the target XpsDocument or PrintQueue.

public:
 override void WriteAsync(System::Windows::Documents::FixedDocument ^ fixedDocument, System::Printing::PrintTicket ^ printTicket);
public override void WriteAsync (System.Windows.Documents.FixedDocument fixedDocument, System.Printing.PrintTicket printTicket);
override this.WriteAsync : System.Windows.Documents.FixedDocument * System.Printing.PrintTicket -> unit

Parameters

fixedDocument
FixedDocument

The document that is written.

printTicket
PrintTicket

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

Remarks

Although the XpsDocument class has a singular name, an XpsDocument can be one FixedDocument or a set of multiple documents. This method adds a FixedDocument to the set.

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