Skip to main content

PdfPrintRequestedEventArgs Class

Definition

Assembly:Avalonia.Controls.PdfViewer
Package:Avalonia.Controls.PdfViewer

Raised before the viewer prints. Set Avalonia.Controls.PdfPrintRequestedEventArgs.Handled to take over printing in the application; the built-in platform print service is then skipped.

public class PdfPrintRequestedEventArgs

Inheritance: EventArgs -> PdfPrintRequestedEventArgs

Methods

NameDescription
GetDocumentBytesAsyncExports the document, including unsaved annotation edits, as PDF bytes.

GetDocumentBytesAsync Method

Exports the document, including unsaved annotation edits, as PDF bytes.

public System.Threading.Tasks.Task<byte[]> GetDocumentBytesAsync(System.Threading.CancellationToken cancellationToken)

Parameters

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<byte[]>

Properties

NameDescription
DocumentThe loaded document.
HandledSet to true when the application has handled the request itself.
OptionsPrint options; the viewer pre-fills Avalonia.Controls.Pdf.Services.PrintOptions.Title and Avalonia.Controls.Pdf.Services.PrintOptions.Owner.

Document Property

The loaded document.

public Avalonia.Controls.Pdf.Core.IPdfDocument Document { get; set; }

Handled Property

Set to true when the application has handled the request itself.

public bool Handled { get; set; }

Options Property

Print options; the viewer pre-fills Avalonia.Controls.Pdf.Services.PrintOptions.Title and Avalonia.Controls.Pdf.Services.PrintOptions.Owner.

public Avalonia.Controls.Pdf.Services.PrintOptions Options { get; set; }