Windows Dev Center

PrintDocument class

Defines a reusable object that sends output to a printer.

Inheritance

Object
  DependencyObject
    PrintDocument

Syntax


public class PrintDocument : DependencyObject

Members

The PrintDocument class has these types of members:

Constructors

The PrintDocument class has these constructors.

ConstructorDescription
PrintDocument Initializes a new instance of the PrintDocument class.

 

Events

The PrintDocument class has these events.

EventDescription
AddPages Occurs when the PrintManager requests the final collection of pages to send to the printer.
GetPreviewPage Occurs when the PrintManager requests a particular print page to be shown in the preview window.
Paginate Occurs when the PrintManager requests the collection of print pages to be shown in the preview window.

 

Methods

The PrintDocument class has these methods. It also inherits methods from the Object class.

MethodDescription
AddPage Adds a XAML root visual element to the print list.
AddPagesComplete Indicates that the application will not add more pages to the print list, and that the print list is ready to be released.
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
InvalidatePreview References the low-level print preview dialog API and invalidates the current print preview.
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
RegisterPropertyChangedCallback Registers an instance-specific property value for a property-changed notification that comes from the core property system. (Inherited from DependencyObject)
SetPreviewPage Sets the specified print page as the current print preview page.
SetPreviewPageCount Sets the number of pages prepared for print preview and added to the print list.
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)
UnregisterPropertyChangedCallback Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from DependencyObject)

 

Properties

The PrintDocument class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. (Inherited from DependencyObject)

DocumentSource

Read-onlyGets a document source reference for this PrintDocument.

DocumentSourceProperty

Read-onlyIdentifies the DocumentSource dependency property.

 

Remarks

PrintDocument implements a print list concept whereby pages can be added to the print list, and then various methods can be called on the ongoing print list.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Printing
Windows::UI::Xaml::Printing [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

Windows.UI.Xaml.Printing
Windows::UI::Xaml::Printing [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
DependencyObject
Quickstart: Adding simple print capability

 

 

Show:
© 2015 Microsoft