PrintDocument PrintDocument PrintDocument PrintDocument Class

Definition

Defines a reusable object that sends output to a printer.

public : class PrintDocument : DependencyObject, IPrintDocumentpublic class PrintDocument : DependencyObject, IPrintDocumentPublic Class PrintDocument Inherits DependencyObject Implements IPrintDocument// This API is not available in Javascript.
Inheritance
PrintDocumentPrintDocumentPrintDocumentPrintDocument
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties

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.

Constructors

PrintDocument() PrintDocument() PrintDocument() PrintDocument()

Initializes a new instance of the PrintDocument class.

public : PrintDocument()public PrintDocument()Public Sub New()// This API is not available in Javascript.

Properties

DocumentSource DocumentSource DocumentSource DocumentSource

Gets a document source reference for this PrintDocument.

public : IPrintDocumentSource DocumentSource { get; }public IPrintDocumentSource DocumentSource { get; }Public ReadOnly Property DocumentSource As IPrintDocumentSource// This API is not available in Javascript.
Value
IPrintDocumentSource IPrintDocumentSource IPrintDocumentSource IPrintDocumentSource

An object representing the document source.

DocumentSourceProperty DocumentSourceProperty DocumentSourceProperty DocumentSourceProperty

Identifies the DocumentSource dependency property.

public : static DependencyProperty DocumentSourceProperty { get; }public static DependencyProperty DocumentSourceProperty { get; }Public Static ReadOnly Property DocumentSourceProperty As DependencyProperty// This API is not available in Javascript.

Methods

AddPage(UIElement) AddPage(UIElement) AddPage(UIElement) AddPage(UIElement)

Adds a XAML root visual element to the print list.

public : void AddPage(UIElement pageVisual)public void AddPage(UIElement pageVisual)Public Function AddPage(pageVisual As UIElement) As void// This API is not available in Javascript.
Parameters
pageVisual
UIElement UIElement UIElement UIElement

The root visual element of the page to add to the print list.

AddPagesComplete() AddPagesComplete() AddPagesComplete() AddPagesComplete()

Indicates that the application will not add more pages to the print list, and that the print list is ready to be released.

public : void AddPagesComplete()public void AddPagesComplete()Public Function AddPagesComplete() As void// This API is not available in Javascript.

InvalidatePreview() InvalidatePreview() InvalidatePreview() InvalidatePreview()

References the low-level print preview dialog API and invalidates the current print preview.

public : void InvalidatePreview()public void InvalidatePreview()Public Function InvalidatePreview() As void// This API is not available in Javascript.

SetPreviewPage(Int32, UIElement) SetPreviewPage(Int32, UIElement) SetPreviewPage(Int32, UIElement) SetPreviewPage(Int32, UIElement)

Sets the specified print page as the current print preview page.

public : void SetPreviewPage(int pageNumber, UIElement pageVisual)public void SetPreviewPage(Int32 pageNumber, UIElement pageVisual)Public Function SetPreviewPage(pageNumber As Int32, pageVisual As UIElement) As void// This API is not available in Javascript.
Parameters
pageNumber
int Int32 Int32 Int32

The sequence number of the page to preview.

pageVisual
UIElement UIElement UIElement UIElement

The root visual object for the requested print page.

See Also

SetPreviewPageCount(Int32, PreviewPageCountType) SetPreviewPageCount(Int32, PreviewPageCountType) SetPreviewPageCount(Int32, PreviewPageCountType) SetPreviewPageCount(Int32, PreviewPageCountType)

Sets the number of pages prepared for print preview and added to the print list.

public : void SetPreviewPageCount(int count, PreviewPageCountType type)public void SetPreviewPageCount(Int32 count, PreviewPageCountType type)Public Function SetPreviewPageCount(count As Int32, type As PreviewPageCountType) As void// This API is not available in Javascript.
Parameters
count
int Int32 Int32 Int32

The number of pages included in the preview.

type
PreviewPageCountType PreviewPageCountType PreviewPageCountType PreviewPageCountType

A value of the enumeration that specifies how to determine the page count.

See Also

Events

AddPages AddPages AddPages AddPages

Occurs when the PrintManager requests the final collection of pages to send to the printer.

public : event AddPagesEventHandler AddPagespublic event AddPagesEventHandler AddPagesPublic Event AddPages// This API is not available in Javascript.

Remarks

Provide Windows with printable pages by calling AddPage for each page to be printed. Pass a UIElement that is the printable content to the AddPage method. Call AddPagesComplete to signal that all of the pages to be printed have been added and Windows can continue with the print job.

If the user specifies particular pages or a range of pages in the print options UI, only the specified pages should be added to the print list.

See Also

GetPreviewPage GetPreviewPage GetPreviewPage GetPreviewPage

Occurs when the PrintManager requests a particular print page to be shown in the preview window.

public : event GetPreviewPageEventHandler GetPreviewPagepublic event GetPreviewPageEventHandler GetPreviewPagePublic Event GetPreviewPage// This API is not available in Javascript.

Remarks

In the handler for this event, call SetPreviewPage to set the requested page as the current print preview page.

See Also

Paginate Paginate Paginate Paginate

Occurs when the PrintManager requests the collection of print pages to be shown in the preview window.

public : event PaginateEventHandler Paginatepublic event PaginateEventHandler PaginatePublic Event Paginate// This API is not available in Javascript.
See Also

See Also