IPdfAdapter Interface
Definition
Platform-agnostic interface for PDF rendering operations.
public interface IPdfAdapter
Methods
| Name | Description |
|---|---|
| LoadDocumentAsync (3 overloads) | Loads a PDF document from a stream. The stream is read once from its current position and is never disposed by the adapter; the document keeps its own copy of the bytes. |
LoadDocumentAsync overloads
LoadDocumentAsync Method
Loads a PDF document from a stream. The stream is read once from its current position and is never disposed by the adapter; the document keeps its own copy of the bytes.
public System.Threading.Tasks.Task<Avalonia.Controls.Pdf.Core.IPdfDocument> LoadDocumentAsync(System.IO.Stream stream, string password, System.Threading.CancellationToken cancellationToken)
Parameters
stream System.IO.Stream
password string
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Pdf.Core.IPdfDocument>
LoadDocumentAsync Method
public System.Threading.Tasks.Task<Avalonia.Controls.Pdf.Core.IPdfDocument> LoadDocumentAsync(ReadOnlyMemory<byte> data, string password, System.Threading.CancellationToken cancellationToken)
Parameters
data ReadOnlyMemory<byte>
password string
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Pdf.Core.IPdfDocument>
LoadDocumentAsync Method
Loads a PDF document from a file path.
public System.Threading.Tasks.Task<Avalonia.Controls.Pdf.Core.IPdfDocument> LoadDocumentAsync(string path, string password, System.Threading.CancellationToken cancellationToken)
Parameters
path string
password string
cancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Pdf.Core.IPdfDocument>
Properties
| Name | Description |
|---|---|
| IsInitialized | Gets whether the adapter has been initialized. |
IsInitialized Property
Gets whether the adapter has been initialized.
public bool IsInitialized { get; set; }
Events
| Name | Description |
|---|---|
| Error | Event raised when the adapter encounters an error. |
Error Event
Event raised when the adapter encounters an error.
public event EventHandler<Avalonia.Controls.Pdf.Core.PdfErrorEventArgs> Error