XpsDocumentWriter.WriteAsync Method (DocumentPaginator)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Windows.Xps
Assembly:  System.Printing (in System.Printing.dll)

public override void WriteAsync(
	DocumentPaginator documentPaginator
)

Parameters

documentPaginator
Type: System.Windows.Documents.DocumentPaginator

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

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);
}

.NET Framework
Available since 3.0
Return to top
Show: