Skip to main content

PdfSaveAsRequestedEventArgs Class

Definition

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

Arguments for Avalonia.Controls.PdfViewer.SaveAsRequested. Set Avalonia.Controls.PdfSaveAsRequestedEventArgs.Handled to write the document in the application instead of through the viewer's built-in save picker; Avalonia.Controls.PdfSaveAsRequestedEventArgs.GetDocumentBytesAsync(System.Threading.CancellationToken) gives the PDF with its current annotation edits.

public class PdfSaveAsRequestedEventArgs

Inheritance: EventArgs -> PdfSaveAsRequestedEventArgs

Methods

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

GetDocumentBytesAsync Method

Exports the document, including 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 open document.
HandledSet to true to skip the built-in save picker.
SuggestedFileNameA file name derived from the document title or source, with a .pdf extension.

Document Property

The open document.

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

Handled Property

Set to true to skip the built-in save picker.

public bool Handled { get; set; }

SuggestedFileName Property

A file name derived from the document title or source, with a .pdf extension.

public string SuggestedFileName { get; set; }