XpsDocumentWriter.WriteAsync Method (String, XpsDocumentNotificationLevel)

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

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

public void WriteAsync(
	string documentPath,
	XpsDocumentNotificationLevel notificationLevel
)

Parameters

documentPath
Type: System.String
The path of the source document.
notificationLevel
Type: System.Windows.Xps.XpsDocumentNotificationLevel
An indication of whether notification is enabled.

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.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft