Class
DocumentSource

Represents an abstract base class for document sources that can be used to load PDF documents in a RadPdfViewer.

Definition

Constructors

DocumentSource()

Initializes a new instance of the DocumentSource class.

Declaration

cs-api-definition
public DocumentSource()

Properties

IsBusy

Gets a value indicating whether the document source is currently busy loading a document.

Declaration

cs-api-definition
public bool IsBusy { get; protected set; }

Property Value

bool

Events

PasswordNeeded

Occurs when a password is needed to open a password-protected PDF document.

Declaration

cs-api-definition
public event EventHandler<PasswordNeededEventArgs> PasswordNeeded

Event Value

EventHandler<PasswordNeededEventArgs>

Operators

implicit operator DocumentSource(Func<CancellationToken, Task<Stream>>)

Implicitly converts a stream function to a DocumentSource.

Declaration

cs-api-definition
public static implicit operator DocumentSource(Func<CancellationToken, Task<Stream>> streamFunc)

Parameters

streamFunc

Func<CancellationToken, Task<Stream>>

The function that provides a stream for the document.

Returns

DocumentSource

A StreamDocumentSource instance.

implicit operator DocumentSource(RadFixedDocument)

Implicitly converts a RadFixedDocument to a DocumentSource.

Declaration

cs-api-definition
public static implicit operator DocumentSource(RadFixedDocument document)

Parameters

document

RadFixedDocument

The document to convert.

Returns

DocumentSource

A FixedDocumentSource instance.

implicit operator DocumentSource(Uri)

Implicitly converts a Uri to a DocumentSource.

Declaration

cs-api-definition
public static implicit operator DocumentSource(Uri uri)

Parameters

uri

Uri

The URI to convert.

Returns

DocumentSource

A UriDocumentSource instance.

implicit operator DocumentSource(byte[])

Implicitly converts a byte array to a DocumentSource.

Declaration

cs-api-definition
public static implicit operator DocumentSource(byte[] bytes)

Parameters

bytes

byte[]

The byte array containing the document data.

Returns

DocumentSource

A ByteArrayDocumentSource instance.

implicit operator DocumentSource(string)

Implicitly converts a string to a DocumentSource.

Declaration

cs-api-definition
public static implicit operator DocumentSource(string source)

Parameters

source

string

The string representing a file path or URI.

Returns

DocumentSource

A UriDocumentSource or FileDocumentSource instance depending on the string format.